1.卸载原有httpd
rpm -e httpd --nodeps
2.解压 httpd-2.2.17
tar -zxvf httpd-2.2.17.tar.gz -C /usr/src
3.编译安装httpd
cd /usr/src/httpd-2.2.17/
./configure --prefix=/usr/local/httpd
make && make install
4.修改httpd.conf文件
vim /usr/local/httpd/conf/httpd.conf
添加以下内容:
#ServerName www.example.com:80
ServerName www.example.com:80
5.将httpd添加到开机启动
cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd
vim /etc/rc/init.d/httpd
添加以下内容:
#!/bin/sh
# chkconfig:2345 61 39
# description:Apache = redhat6.5
chkconfig --add httpd
6.重启httpd服务
service httpd restart