apache加入chkconfig

#First Step:
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd

#Second Step:
vim /etc/init.d/httpd
在第一行#!/bin/sh下增加两行文字
# chkconfig: 35 70 30
# description: Apache

#Third Step:
保存退出
chkconfig --level 35 httpd on

#Forth Step:
重启httpd服务
/usr/local/apache2/bin/apachectl restart


/* 
35 系统运行级别      70 开机时的启动顺序  30 关机时的关闭顺序 两个数字的和是一般是一百 在/etc/rc.d/rc3.d 内会显示这两个值

*/

#测试
/etc/init.d/httpd stop
ps aux|grep httpd
netstat -lnp|grep httpd

/* 查看是否顺利将其关掉 */