日期:2014-05-16  浏览次数:20709 次

《linux设置apache自启动》

Apache安装路径为:/usr/local/apache
Linux的启动级别为5,版本为CentOS5Apache安装完后,创造Apache无法主动 启动,查察 /etc/rc.d/rc5.d/下,应当没有S打头,httpd最后的链接文件。
1、将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc5.d/下介入链接即可。
下令如下:
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd //假如有其他的版本的Apache存在,也可以直接覆盖掉
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd????? //成立链接(85的意义后头先容 )
此时Apache就可以主动 启动了。


2、运行chkconfig --list,创造没有linux做事列表中httpd,通过chkconfig --add httpd来添加,但是提醒:httpd做事不支持 chkconfig。必要 编辑 /etc/rc.d/init.d/httpd,添加以下解释信息:
# chkconfig: 345 85 15
# descrīption: Apache
第一行3个数字参数意义判别 为:哪些Linux级别必要 启动httpd(3,4,5);启动序号(85);封闭序号(15)。
生涯后推行 :chkconfig --add httpd,乐成 添加。
在rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件,其他运行级别路径中会出现K61httpd的链接文件。


3、运行chkconfig --list,httpd在此中。