1. 啟動、終止、重啟
systemctl start httpd.service #啟動
systemctl stop httpd.service #停止
systemctl restart httpd.service #重啟
2. 設置開機啟動/關閉
systemctl enable httpd.service #開機啟動
systemctl disable httpd.service #開機不啟動
systemctl list-unit-files | grep httpd # 檢查Apache是否已經安裝了開機自動啟動
顯示以下內容即已成功設置:
3. 檢查httpd狀態
systemctl status httpd.service #檢查狀態
參考文章:CentOS7.6中安裝Apache及Apache常見操作和配置說明
CSDN 社區圖書館,開張營業!
深讀計劃,寫書評領圖書福利~