1. install Apache
$ Sudo apt-Get install apache2
Test:
Enter http: // 192.168.21.20./ in the browser/
192.168.21.20.for Ubuntu IP
2. install PHP
$ Sudo apt-Get install PhP5
$ Sudo apt-Get install libapache2-mod-php5
$ Sudo/etc/init. d/apache2 restart
Test: sudo Vim/var/www/test. php
Vim input:
Enter http: // 192.168.21.20./ test. php in the browser.
Output Hello world in the browser, indicating that the installation is correct
3. Install MySQL
$ Sudo apt-Get install mysql-Server
Enable external access permissions
$ Grant all privileges on *. * to root @ "%" identified by "123456 ";
$ Sudo VI/etc/MySQL/My. CNF
Bind-address = 127.0.0.1 => bind-address = IP address of your machine
Or comment the bind-address = 127.0.0.1 line.
This allows other machines to access MySQL.
Reference: http://wiki.ubuntu.org.cn/MySQL%E5% AE %89%E8%A3%85%E6%8C%87%E5%8D%97
4. Make Apache and PHP support MySQL
$ Sudo apt-Get install libapache2-mod-auth-mysql
$ Sudo apt-Get install php5-mysql
$ Sudo/etc/init. d/apache2 restart
5. Install phpMyAdmin
$ Sudo apt-Get install phpMyAdmin
$ Sudo ln-S/usr/share/PHPmyAdmin/var/www/
Use: http: // localhost/PHPmyAdmin/for access
Reference: http://www.linuxidc.com/Linux/2010-07/27230.htm