在linux 源碼編譯安裝了apache 服務
apache 服務啟動指令:
/usr/local/apache/bin/apachectl start 或是把apachectl 軟連結或cp到 /sbin目錄下
apachectl start
用chkconfig 工具讓apache服務運作在運作級别345下面, 指令如下:
cp /usr/local/apache/bin/apachectl /etc/init.d/apachectl
ln -s /etc/init.d/apachectl /etc/rc.d/rc3.d/apachectl
vi /etc/init.d/apachectl
在行 #!/bin/sh 下,添加一行
# chkconfig: 345 85 15
chkconfig --add apachectl
到此 apache服務就可以在運作級别345下 随機自動啟動了。
另外,也可把啟動指令 /usr/local/apache/bin/apachectl start 直接寫入 /etc/rc.d/rc.local 檔案中,達到開啟啟動的目的
本文轉自筆下生輝 51CTO部落格,原文連結:http://blog.51cto.com/752030200/1726555,如需轉載請自行聯系原作者