1. install apache $ sudoapt-getinstallapache2 test: input in the browser: 192.168.21.133192.168.21.20.for ubuntuIP2. install PHP $ sudoapt-getinstallphp5 $ sudoapt-getinstalllibapache2-mod-php5 $ sudoetcinit. dapache2restart test: s
1. install apache $ sudo apt-get install apache2 test: Enter http: // 192.168.21.20./ 192.168.21.20.as ubuntu IP address 2 in the browser. install PHP $ sudo apt-get install php5 $ sudo apt-get install libapache2-mod-php5 $ sudo/etc/init. d/apache2 restart test: s
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