sudo apt-get update && sudo apt-get upgrade
Install apache
sudo apt-get install apache2
Install mysql
sudo apt-get install mysql-server
Run secure mysql connection
mysql_secure_installation
Install PHP
sudo apt-get install php5 php-pear
sudo apt-get install php5-mysql
Once PHP5 is installed, tune the configuration file located in /etc/php5/apache2/php.ini to enable more descriptive errors, logging, and better performance. The following modifications provide a good starting point:
/etc/php5/apache2/php.ini
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR error_log = /var/log/php/error.log max_input_time = 30
Create the log directory for PHP and give the Apache user ownership:
sudo mkdir /var/log/php sudo chown www-data /var/log/php
Reload Apache:
sudo service apache2 reload
tips: https://www.linode.com/docs/websites/lamp/lamp-on-ubuntu-14-04