1、apache
tar zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache --enable-shared=max --enable-module=most --enable-so
make
make install
安裝成功
2、MySQL
tar zxvf MySQL-max-5.0.27-Linux-i686-glibc23.tar.gz
mv mysql-5.0.37-Linux-i686 /usr/local/MySQL/
cd /usr/local/MySQL/
[root@localhost mysql]# groupadd MySQL
[root@localhost mysql]# useradd -g mysql MySQL 或
# pw groupadd mysql #建立MySQL組
# pw useradd mysql -g mysql -s /user/sbin/nologin #建立mysql用戶並且加入到MySQL組中
./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/MySQL
[root@localhost MySQL]#make
[root@localhost MySQL]#make install
./scripts/mysql_install_db --user=MySQL
cp /usr/local/MySQL/support-files/my-medium.cnf /etc/my.cnf
[root@localhost MySQL]# chown -R root .
[root@localhost mysql]# chown -R MySQL data
[root@localhost mysql]# chgrp -R MySQL .
[root@localhost mysql]# chgrp -R mysql . #設定mysql組能夠訪問/usr/local/MySQL
cp support-files/mysql.server /etc/init.d/MySQLd
chkconfig --add MySQLd
查看apachectl的狀態:
chkconfig --list MySQLd
重新啟動 MySQL:
service MySQLd restart
/usr/local/mysql/bin/MySQLd_safe &
停止MySQL
Killall -9 MySQLd (有root權限)
讓DOS等界面支持連接,在配置文件裡加入這句話:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
3、PHP
安裝PHP-5.2.1.tar.gz
tar zxvf PHP-5.2.1.tar.gz
cd PHP-5.2.1
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/MySQL --with-config-file-path=/usr/local/PHP/etc
make
make install
# cp /usr/local/src/php-4.3.8/php.ini-dist /usr/local/php/etc/PHP.ini
vi /usr/local/httpd/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在其下添加如下內容
AddType application/x-httpd-php .PHP
AddType application/x-httpd-php-source .PHPs
<IfModule mod_PHP5.c>
AddType application/x-httpd-php .PHP
</IfModule>
默認索引頁
Directory index.Html index.PHP
測試
vi /usr/local/httpd/htdocs/index.PHP
<?
PHPinfo()
?>
在IE中輸入
http://ip/index.PHP