1. 程式人生 > >apache ubunte 重啟命令

apache ubunte 重啟命令

apach 重啟命令 重啟 操作 服務器 AC art graceful IV

查看apache2的命令 httpd -V
其中HTTPD_ROOT和SERVER_CONFIG_FILE 就可以確定httpd.conf的路徑了

假設當前Linux用戶的apahce安裝目錄為/usr/local/apache2,那麽在命令行終端中使用以下命令啟動,停止和重啟apache。
1. 啟動apahce的命令:
/usr/local/apache2/bin/apachectl start apache
2. 停止apache的命令:
/usr/local/apache2/bin/apachectl stop
3. 重啟apache的命令:
/usr/local/apache2/bin/apachectl restart
要在重啟 Apache 服務器時不中斷當前的連接,則應運行:
/usr/local/sbin/apachectl graceful

如果當前用戶的apache已經安裝為linux的服務的話,可以使用以下命令進行以上操作。
1. 啟動apache
service httpd start
2. 停止服務apache
service httpd stop
3. 重新啟動apache
service httpd restart

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

apache ubunte 重啟命令