apachectl 是 httpd 守護進程的前端控制程式,提供兩種操作模式:
httpd,傳遞所有命令列參數。httpd。# 透傳模式
apachectl [httpd-argument]
# SysV init 模式
apachectl command
| 指令 | 說明 | 等效參數 |
|---|---|---|
| start | 啟動 httpd(已運行則報錯) | apachectl -k start |
| stop | 立即停止 httpd | apachectl -k stop |
| restart | 重啟(先 configtest),未運行則啟動 | apachectl -k restart |
| graceful | 優雅重啟(不中斷現有連線,不立即關閉日誌) | apachectl -k graceful |
| graceful-stop | 優雅停止(等待現有連線完成) | apachectl -k graceful-stop |
| configtest | 語法檢查(不啟動) | apachectl -t |
| status | 簡略狀態(需 mod_status + lynx) | — |
| fullstatus | 完整狀態報表 | — |
apachectl 修改 HTTPD 變數指向正確 httpd。httpd 參數:同樣在腳本中設定。startssl:舊版 SSL 啟動方式,現建議直接在設定檔啟用 SSL 並用 apachectl start。
STATUSURL:status/fullstatus 存取 URL,預設 https://localhost:80/server-status。