Install LAMP stack on Ubuntu 16.04

Update system

sudo apt-get update && sudo apt-get dist-upgrade

Install Apache

sudo apt-get install apache2

Install MySQL

sudo apt-get install mysql-server

Install PHP

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-mbstring php-gettext

Install PHPMyAdmin

sudo apt-get install phpmyadmin

1. Web server to reconfigure automatically: choose apache2.
2. Configure database for phpmyadmin with dbconfig-common?: yes.

Remove default index file

sudo rm /var/www/html/index.html
sudo touch /var/www/html/index.php

Restrict PHPMyAdmin

sudo nano / etc/apache2/conf-available/phpmyadmin.conf
	Options FollowSymLinks
	DirectoryIndex index.php
	Order Deny,Allow
	Deny from all
	Allow from
	Allow from x.x.x.0/24

Restart Apache

sudo service apache2 restart
Categories: Apache, Linux, MySQL, PHP, Ubuntu Server Tags: , , ,
%d bloggers like this: