Apache httpd 以root身份运行
1、卸载httpd
rpm -qa|grep httpd
说明:rpm –qa | grep httpd 命令是为了把httpd 相关的包都列出来
rpm –e httpd-manual-2.2.3-11.el5_2.centos.4
2、安装apr
tar zxvf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure
make
make install
echo "/usr/local/apr/lib" >>/etc/ld.so.conf
ldconfig
3、安装expat-devel
yum install expat-devel -y
4、安装apr-util
tar zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --with-apr=/usr/local/apr
make
make install
5、安装pcre
tar zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure --with-apr=/usr/local/apr
make
make install
6、安装httpd
tar zxvf httpd-2.4.34.tar.gz
cd httpd-2.4.34
修改Apache 源代码,在 include/http_config.h 头部中自行添加如下语句
#ifndef BIG_SECURITY_HOLE
#define BIG_SECURITY_HOLE
#endif
./configure --prefix=/usr/local/httpd --enable-ssl --enable-cgi --enable-mods-shared=allable-ssl --enable-cgi --enable-mods-shared=all --enable-track-vars --enable-rewrite
make
make install
cd /usr/local/httpd/
7、编辑httpd.conf
......
User root
Group root
......
8、重启apache
/usr/local/httpd/bin/apachectl start|stop