1. httpd 2.2.22 安装
步骤一
#tar zxvf httpd-2.2.22.tar.gz
#./configure --enable-dav --enable-so --prefix=/usr/local/httpd/
#make
#make install
步骤二
如果没有配置开机自启,需手动配置
# cp -rf /usr/local/httpd/apachectl /etc/init.d/httpd
步骤三
修改/etc/init.d/httpd
vi httpd
在 #!/bin/sh 下面增加几行 chkconfig 需要的内容:
# chkconfig: 2345 70 30
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(2,3,4,5);启动序号(70);关闭序号(30)。
保存后执行:chkconfig --add httpd,成功添加。
如果不添加上述内容会出现:
httpd服务不支持 chkconfig
步骤四
chkconfig --add httpd
如需删除
chkconfig --del httpd
2. 启动/重启/关闭
/usr/local/httpd/bin/httpd -k start/restart/stop
服务启动
#service httpd start/restart/stop
#httpd开机启动
#chkconfig --level 345 httpd on