(1) Install MySQL:
sudo apt-get install mysql-server mysql-client
(2) Installation Apache2
sudo apt-get install apache2
To test if Apache is working properly, enter it in the browser: http://ip/
(3) Installing PHP
sudo apt-get install php5 libapache2-mod-php5
Restart Apache and let it load the PHP module
Sudo/etc/init.d/apache2 restart
(4) Installation phpMyAdmin
sudo apt-get install phpMyAdmin
Then connect phpMyAdmin with Apache2, in my case: the WWW directory is in the/var/www,phpmyadmin directory in/usr/share/phpmyadmin, so just use the command:
sudo ln-s/usr/share/phpmyadmin/var/www
Establish the connection.
Enter the http://ip/phpmyadmin/test in the browser phpMyAdmin is working properly!
If you need to change the Apache default var/www directory, you need to go to/etc/apache2/sites-enabled and then open the 000-default file in this directory for editing
Ubuntu 12.04 Manual Build Apache+php+mysql+phpmyadmin