[root@localhost Packages]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 三 2021-12-29 21:23:38 CST; 1h 24min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 1924 (code=exited, status=1/FAILURE)
12月 29 21:23:38 localhost.localdomain systemd[1]: Starting The Apache HTTP Server…
12月 29 21:23:38 localhost.localdomain httpd[1924]: AH00558: httpd: Could not reliably determine th…age
12月 29 21:23:38 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited,…URE
12月 29 21:23:38 localhost.localdomain kill[1926]: kill: cannot find process “”
12月 29 21:23:38 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exit…s=1
12月 29 21:23:38 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
12月 29 21:23:38 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
12月 29 21:23:38 localhost.localdomain systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
解决办法:
[root@localhost conf]# vi httpd.conf
[root@localhost conf]# cat httpd.conf
353行 (注销)
启动
[root@localhost Packages]# systemctl start httpd.service
关闭
[root@localhost Packages]# systemctl stop httpd.service
重启
[root@localhost Packages]# systemctl restart httpd.service
设定开机自启动
[root@localhost Packages]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
取消开机自启动
[root@localhost Packages]# systemctl disable httpd.service
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.
查看状态
[root@localhost Packages]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since 三 2021-12-29 22:51:31 CST; 44s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 2628 (httpd)
Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”
CGroup: /system.slice/httpd.service
├─2628 /usr/sbin/httpd -DFOREGROUND
├─2629 /usr/sbin/httpd -DFOREGROUND
├─2630 /usr/sbin/httpd -DFOREGROUND
├─2631 /usr/sbin/httpd -DFOREGROUND
├─2632 /usr/sbin/httpd -DFOREGROUND
└─2633 /usr/sbin/httpd -DFOREGROUND
12月 29 22:51:31 localhost.localdomain systemd[1]: Starting The Apache HTTP Server…
12月 29 22:51:31 localhost.localdomain httpd[2628]: AH00558: httpd: Could not reliably determine th…age
12月 29 22:51:31 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.