linux 下 apache啓動、停止、重啓命令

基本的操作方法:
本文假設你的apahce安裝目錄爲/usr/local/apache2,這些方法適合任何情況
apahce啓動命令:
推薦/usr/local/apache2/bin/apachectl start apaceh啓動
apache停止命令
/usr/local/apache2/bin/apachectl stop 停止
apache重新啓動命令:
/usr/local/apache2/bin/apachectl restart 重啓
要在重啓 Apache 服務器時不中斷當前的連接,則應運行:
/usr/local/sbin/apachectl graceful
如果apache安裝成爲linux的服務的話,可以用以下命令操作:
service httpd start 啓動
service httpd restart 重新啓動
service httpd stop 停止服務

Linux系統爲Ubuntu
一、Start Apache 2 Server /啓動apache服務

/etc/init.d/apache2 start

or
$ sudo /etc/init.d/apache2 start
二、 Restart Apache 2 Server /重啓apache服務

/etc/init.d/apache2 restart

or
$ sudo /etc/init.d/apache2 restart
三、Stop Apache 2 Server /停止apache服務

/etc/init.d/apache2 stop

or
$ sudo /etc/init.d/apache2 stop

發佈了57 篇原創文章 · 獲贊 34 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章