Apache的开机自启动,并注册成一个服务

来源:互联网 发布:网络用语kpi什么意思 编辑:程序博客网 时间:2024/05/16 10:37

 

1.  

1开机自启动:进入rc.local目录。cd  /etc/init.d/rc.local ,加入以下语句

/usr/apache/bin/apachectl –k start(注意:centos,redhat 目录是在etc/rc.d/init.d/rc.local)

2 .加入服务:进入cd /etc/init.d/ 目录下,copy apachectl文件到该目录下:cp /usr/apache/bin/apachectl apachectl。重命名apachectlhttpd:mv apachectl httpd,。注册服务:chkconfig –add httpd ,启动服务.

 

原创粉丝点击