《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在此中。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章