LAMP on Ubuntu
apt-get install mysql-server mysql-client
You will be asked to provide a password for the MySQL root user - this password is valid for the user root@localhost as well as root@server1.example.com, so we don't have to specify a MySQL root password manually later on.
2. Installing Apache2
apt-get install apache2
Now direct your browser to http://ServerIP, and you should see the Apache2 placeholder page (It works!):
3. Installing PHP5
apt-get install php5 libapache2-mod-php5 php5-mysql
/etc/init.d/apache2 restart
4. Testing PHP5 / Getting Details About Your PHP5 Installation
<?php
phpinfo();
?>