In your terminal, you will run the following commands:

sudo apt-get install apache2
sudo apt-get install php5
sudo /etc/init.d/apache2 restart

Note that if apache is already installed you can omit the first line. Your web files will now be found in /var/www/

After restarting your apache, we will see this line:
It works!
This is the default web page for this server.

In case we dont have permission to write the www/ folder, we need to change its permission.

sudo chown -R yourusernamehere /var/www/

After you install the PHP and Apache. Now its time to install the mysql.
Click here on how to install mysql on ubuntu.

References:
http://askubuntu.com/questions/100976/how-can-i-write-to-var-www
http://askubuntu.com/questions/151590/what-is-the-default-permission-for-var-www
http://askubuntu.com/questions/45496/what-is-the-best-way-to-add-files-to-a-website-on-a-lamp-server/

Advertisements