Skip to main content

Installing LAMP on Ubuntu 16.04.01

Mark Bonnot

In this tutorial / knowlegde base article we iwll go over the Installation and Setup of you LAMP stack.

This document assume that you have shell/teminal access to you ubuntu 16.04 server.

  1. Install Apache (most likely optional as it probably alreay installed)
    1. find out what version of apache you are running:apache2 -v and you want 2.4.x version
    2. sudo apt update
    3. sudo apt upgrade
    4. sudo apt install apache2
  2. Install MySQL/MariaDB
    1. sudo sh -c 'echo "deb" `lsb_release -cs` main" >> /etc/apt/sources.list.d/MariaDB.list'
    2. sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
    3. sudo apt install mariadb-server
    4. mysql_secure_installation
  3. Install PHP 7.2
    1. sudo add-apt-repository ppa:ondrej/php
    2. sudo apt update
    3. if there is an issue:sudo apt-get install software-properties-common python-software-properties
    4. sudo apt update
    5. sudo apt install php7.2
    6. sudo apt install php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml php7.2-phalcon
    7. disable previous php version sudo a2dismod php7.1
    8. enable new php version sudo a2enmod php7.2
    9. edit the timezone to America/New_York or whichever is applicable for you.
  4. Apache2 Extensions to enable
    1. To allow htaccess: sudo a2enmod rewrite
    2. To allow Headers (Caching): sudo a2enmod headers
    3. To allow Expires (Caching): sudo a2enmod expires
Categories: LAMP Setup LDAP Testing