http_port_t,8989 port 不是 httpd 程序允許訪問的 port。
[root@kvm7 html]# semanage port -l | grep -w http_port http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000
[root@kvm7 html]# vim /etc/httpd/conf/httpd.conf [root@kvm7 html]# grep ^Listen /etc/httpd/conf/httpd.conf Listen 8989
[root@kvm7 html]# systemctl restart httpd.service Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
[root@kvm7 html]# systemctl status httpd.service httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) Active: failed (Result: exit-code) since Thu 2019-10-17 07:23:04 CST; 15s ago .... Oct 17 07:23:04 kvm7.deyu.wang systemd[1]: Starting The Apache HTTP Server... Oct 17 07:23:04 kvm7.deyu.wang httpd[17917]: (13)Permission denied: AH00072:...9 Oct 17 07:23:04 kvm7.deyu.wang httpd[17917]: (13)Permission denied: AH00072:...9
[root@kvm7 html]# semanage port -a -t http_port_t -p tcp 8989
[root@kvm7 html]# systemctl restart httpd.service
[root@kvm7 html]# curl http://127.0.0.1:8989/index.html
October 2019
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31