构建网络安全长城之烽火台的建立(4)

这样的信息,就表示已经成功启动了

d.之后,我们要让mysql在以运行级3、5启动的时候能够自动运行起来

[root@netserver mysql-4.0.15a]#cp support-files /mysql.server /etc/init.d/mysql
[root@netserver mysql-4.0.15a]#ln -s /etc/init.d/mysql /etc/rc3.d/S85mysql
[root@netserver mysql-4.0.15a]#ln -s /etc/init.d/mysql /etc/rc3.d/K85mysql
[root@netserver mysql-4.0.15a]#ln -s /etc/init.d/mysql /etc/rc5.d/S85mysql
[root@netserver mysql-4.0.15a]#ln -s /etc/init.d/mysql /etc/rc5.d/K85mysql
[root@netserver mysql-4.0.15a]#chmod 755 /etc/init.d/mysql
[root@netserver mysql-4.0.15a]#cd ../

6、编译安装支持PHP的Apache

a.首先安装apache,假设将它安装到/www目录中,并以模块方式加载PHP

[root@netserver ids]#tar -xvzf httpd-2.0.47.tar.gz
[root@netserver ids]#cd httpd_2.0.47
[root@netserver httpd_2.0.47]#./configure --prefix=/www --enable-so
[root@netserver httpd_2.0.47]#make
[root@netserver httpd_2.0.47]#make install

用以下命令,看看apahce是否能启动起来

[root@netserver httpd_2.0.47]#/www/bin/apachectl start

(因为我们还没有配置httpd.conf,所以这里会提示没有设置Server Name,不用理会)

[root@netserver httpd_2.0.47]#cd ..

B.接下来安装PHP

[root@netserver ids]#tar -xvzf php-4.3.3.tar.gz
[root@netserver ids]#cd php-4.3.3
[root@netserver php-4.3.3]#./configure --prefix=/www/php --with-apxs2=/www/bin/apxs --with-config- filepath=/www/php --enable-sockets --with-mysql=/usr/local/mysql --with-zlibdir=/usr/local --with- gd (在实际书写的时候,请写成一行)
[root@netserver php-4.3.3]#make
[root@netserver php-4.3.3]#make install
[root@netserver php-4.3.3]#cp php.ini-dist /www/php/php.ini

C.配置apache的httpd.conf文件和PHP的php.ini文件

[root@netserver php-4.3.3]# vi /www/conf/httpd.conf

改变以下几行为所写的样式(如果文中没有,请添加该行)

ServerRoot "/www"
DocumentRoot "/www/htdocs"
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .php3 .php4
DirectoryIndex index.php default.php index.htm default.htm index.html default.html
AddDefaultCharset GB2312
ServerName (你的ip地址):80

[root@netserver php-4.3.3]# vi /www/php/php.ini
将 register_globals = Off 这行改为register_globals = On

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus