(Source from: stewright.me)

Step 3 – Install Apache

Here’s where the fun begins. We’re going to start by installing Apache and some other packages. To do this its begin with entering:

sudo bash

This means we’re not having to type sudo each time we run a command. When you’ve done this, enter the following:

apt-get install apache2 apache2-doc apache2-utils

This shouldn’t take long. Once we’ve done that we’re going to install a few support packages including PHP. Once complete, enter the following command:

apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

This too shouldn’t take too long. Follow up with installing the support package for database connectivity:

apt-get install php5-mysql

Now we’re going to install MySQL server. Do this by entering the following command:

apt-get install mysql-server mysql-client

As part of the installation, you’ll be asked to set a root password. Enter a password and then confirm it when prompted in the blue screen.

THEN!

sudo apt-get install libapache2-mod-php5
sudo nano /etc/apache2/apache2.conf

#At the end of the file add: (if it’s not there)

AddType application/x-httpd-php .php