說明: Apache安裝路徑為:/usr/local/apache
Linux啟動級別為3 版本為CentOS 4.5
Apache安裝完后,發現Apache無法自動啟動,查看/etc/rc.d/rc3.d/下,應該沒有S打頭,httpd結尾的鏈接文件。
將apachectl文件拷貝到/etc/init.d 中,然后在/etc/rc.d/rc3.d/下加入鏈接即可。
命令如下:
/usr/local/apache/bin/apachectl /etc//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/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在其中。
posted on 2008-07-27 23:36
七匹狼 閱讀(347)
評論(0) 編輯 收藏