redhat 添加httpd服務的方法
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd 增加httpd服務
vi /etc/rc.d/init.d/httpd
在第2行加入
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
1、添加httpd服務:
[root@localhost ~]# chkconfig --add httpd
2、檢視httpd服務:
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
3、開機時自動運作httpd服務:
[root@localhost ~]# chkconfig --level 345 httpd on
4、檢視httpd服務狀态:
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:關閉 1:關閉 2:關閉 3:啟用 4:啟用 5:啟用 6:關閉
本文轉自 holy2009 51CTO部落格,原文連結:http://blog.51cto.com/holy2010/354332