Installing LAMP on Ubuntu 16.04.01
03.07.2018
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.
-
Install Apache (most likely optional as it probably alreay installed)
- find out what version of apache you are running:
apache2 -v
and you want 2.4.x version sudo apt update
sudo apt upgrade
sudo apt install apache2
- find out what version of apache you are running:
- Install MySQL/MariaDB
sudo sh -c 'echo "deb http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu" `lsb_release -cs` main" >> /etc/apt/sources.list.d/MariaDB.list'
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo apt install mariadb-server
mysql_secure_installation
- Install PHP 7.2
sudo add-apt-repository ppa:ondrej/php
sudo apt update
- if there is an issue:
sudo apt-get install software-properties-common python-software-properties
sudo apt update
sudo apt install php7.2
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
- disable previous php version
sudo a2dismod php7.1
- enable new php version
sudo a2enmod php7.2
- edit the timezone to
America/New_York
or whichever is applicable for you.
-
Apache2 Extensions to enable
- To allow htaccess:
sudo a2enmod rewrite
- To allow Headers (Caching):
sudo a2enmod headers
- To allow Expires (Caching):
sudo a2enmod expires
- To allow htaccess: