[root@kvm8 ~]# systemctl status httpd.service
× httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Thu 2025-10-09 13:36:57 CST; 21min ago
Invocation: 9032bd5315bf4dfc99ab9ee27cfd05d2
Docs: man:httpd.service(8)
Process: 800 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 800 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."
Mem peak: 7.6M
CPU: 123ms
Oct 09 13:36:56 kvm8.deyu.wang systemd[1]: Starting httpd.service -
The Apache HTTP Server...
Oct 09 13:36:56 kvm8.deyu.wang (httpd)[800]: httpd.service: Referenced
but unset environment variable evaluates to an empty string: OPTIONS
Oct 09 13:36:57 kvm8.deyu.wang httpd[800]: AH00558: httpd: Could not
reliably determine the server's fully qualified domain name,
using kvm8.deyu.wang. Set the 'ServerNam>
Oct 09 13:36:57 kvm8.deyu.wang httpd[800]: (13)Permission denied: AH00072:
make_sock: could not bind to address [::]:82
Oct 09 13:36:57 kvm8.deyu.wang httpd[800]: (13)Permission denied: AH00072:
make_sock: could not bind to address 0.0.0.0:82
Oct 09 13:36:57 kvm8.deyu.wang httpd[800]: no listening sockets available,
shutting down
Oct 09 13:36:57 kvm8.deyu.wang httpd[800]: AH00015: Unable to open logs
Oct 09 13:36:57 kvm8.deyu.wang systemd[1]: httpd.service: Main process exited,
code=exited, status=1/FAILURE
Oct 09 13:36:57 kvm8.deyu.wang systemd[1]: httpd.service: Failed with result
'exit-code'.
Oct 09 13:36:57 kvm8.deyu.wang systemd[1]: Failed to start httpd.service -
The Apache HTTP Server.
http_port_t,82 port 不是 httpd 程序允許訪問的 port。
[root@kvm8 ~]# semanage port --list | grep http http_cache_port_t tcp 8080, 8118, 8123, 10001-10010 http_cache_port_t udp 3130 http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t tcp 5988 pegasus_https_port_t tcp 5989
[root@kvm8 ~]# semanage port --add --type http_port_t --proto tcp 82
http_port_t,82 port 已經是 httpd 程序允許訪問的 port。
[root@kvm8 ~]# semanage port --list | grep http http_cache_port_t tcp 8080, 8118, 8123, 10001-10010 http_cache_port_t udp 3130 http_port_t tcp 82, 80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t tcp 5988 pegasus_https_port_t tcp 5989
[root@kvm8 ~]# systemctl restart httpd.service
[root@kvm8 ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
Active: active (running) since Thu 2025-10-09 14:04:50 CST; 2min 12s ago
Invocation: 2b1a669432084054ba07537add6dcdc5
Docs: man:httpd.service(8)
Main PID: 1617 (httpd)
Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec: 0 B/sec"
Tasks: 177 (limit: 10692)
Memory: 13.1M (peak: 13.3M)
CPU: 607ms
CGroup: /system.slice/httpd.service
├─1617 /usr/sbin/httpd -DFOREGROUND
├─1618 /usr/sbin/httpd -DFOREGROUND
├─1619 /usr/sbin/httpd -DFOREGROUND
├─1621 /usr/sbin/httpd -DFOREGROUND
└─1632 /usr/sbin/httpd -DFOREGROUND
Oct 09 14:04:50 kvm8.deyu.wang systemd[1]: Starting httpd.service -
The Apache HTTP Server...
Oct 09 14:04:50 kvm8.deyu.wang (httpd)[1617]: httpd.service: Referenced
but unset environment variable evaluates to an empty string: OPTIONS
Oct 09 14:04:50 kvm8.deyu.wang httpd[1617]: Server configured,
listening on: port 82
Oct 09 14:04:50 kvm8.deyu.wang systemd[1]: Started httpd.service -
The Apache HTTP Server.