LINUX下Apache自啟動

來源:互聯網
上載者:User
本人http2.x很正常,但是沒有配置成開機自動運行.
於是我就cp /home/apache2/bin/apachectl /etc/rc.d/init.d/httpd
然後chkconfig httpd on,
系統提示:httpd服務不支援chkconfig?
問題出在哪裡了呢?我每次只好手動啟動了

---------------------------------------------------------------------

caojiqun 回複於:2004-10-03 19:25:06

不知道你是什麼系統,我的做法是在/etc/rc2.d加一個S99Apache,裡面寫上
/home/apache2/bin/apachectl start &

---------------------------------------------------------------------

mrsanny 回複於:2004-10-10 16:53:13

我的系統是redhat9.0

---------------------------------------------------------------------

level 回複於:2004-10-11 08:36:07

用這個命令try:chkconfig --add httpd

---------------------------------------------------------------------

wudicc 回複於:2004-10-25 16:18:38

從/usr/local/apache/bin/apachectl 到 /etc/rc.d/init.d/httpd 建立一個符號串連:
# ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd

然後在此檔案總添加以下幾行(大概在檔案頂部,約第二行的地方):

# chkconfig: 2345 10 90 (10 和 90是代表的意思我還不太清楚,請高手指教)
# description: Activates/Deactivates Apache Web Server

最後,運行chkconfig把Apache添加到系統的啟動服務組裡面:

# /sbin/chkconfig --del httpd
# /sbin/chkconfig --add httpd

---------------------------------------------------------------------

fke7985 回複於:2005-02-22 16:05:13

# chkconfig: 2345 10 90 (10 和 90是代表的意思我還不太清楚,請高手指教)
# description: Activates/Deactivates Apache Web Server

2345是要設為要啟動的運行層級,10是起啟優先順序,樓上的兄弟,10這個數可能太小啦,有可能apache依賴的服務沒有啟動(好像也沒有依賴什麼其它的服務),後面一個數也就是90是殺死進程的優先順序,就是誰優先掛掉的意思,呵呵

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.