2022年7月26日 星期二

重啟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