linux文件服務器httpd開機自啓動

一、相關命令

1.查看所有系統服務

systemctl list-units --all --type=service

2.查詢服務狀態

systemctl status httpd.service

3.查詢服務是否爲開機啓動

systemctl is-enabled httpd.service

enabled是 disabled否

4.設置服務爲開機啓動狀態

systemctl enable httpd.service

會自動創建一個系統鏈接

Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

5.設置服務爲開機不啓動狀態

systemctl disable httpd.service

會自動移除系統鏈接

Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.

二、設置httpd開機自啓動

systemctl enable httpd.service

重啓即可。

更多博客內容詳見我的博客 Wang's Blog

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章