1>CentOS
yum install mysql mysql-server
chkconfig --levels 235 mysqld on/etc/init.d/httpd restart
2>Ubuntu
1.安裝 Apache
sudo apt-get install apache2
2.測試 Apache
http://localhost/
3.安裝 PHP5
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
4.測試 PHP
sudo gedit /var/www/testphp.php
<?php phpinfo(); ?>
http://localhost/testphp.php
5.安裝 MySQL
sudo apt-get install mysql-server
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin