我试图在 centos 8 上设置 apache。该服务正在运行。当我用 wget 测试时,我得到 403
$ wget 127.0.0.1:9000
--2020-02-21 11:27:42-- http://127.0.0.1:9000/
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... 403 Forbidden
2020-02-21 11:27:42 ERROR 403: Forbidden.
我将所有者更改为/var/www/html/
用户apache
组,但我没有帮助。
$ ls -laZ /var/www/html
total 8
drwxr-xr-x. 2 apache root system_u:object_r:httpd_sys_content_t:s0 4096 Dec 23 20:47 .
drwxr-xr-x. 4 root root system_u:object_r:httpd_sys_content_t:s0 4096 Feb 21 10:27 ..
当我运行自动报告时,我看到了这个
$ sudo aureport -a codingsafari@213
AVC Report
===============================================================
# date time comm subj syscall class permission obj result event
===============================================================
1. 02/16/2020 20:52:51 ? (null) 0 (null) (null) (null) unset 745
2. 02/16/2020 22:35:35 ? (null) 0 (null) (null) (null) unset 1391
3. 02/21/2020 10:29:41 httpd system_u:system_r:httpd_t:s0 49 tcp_socket name_bind system_u:object_r:websm_port_t:s0 denied 1144
4. 02/21/2020 10:29:41 httpd system_u:system_r:httpd_t:s0 49 tcp_socket name_bind system_u:object_r:websm_port_t:s0 denied 1145
在这一点上,我不知道如何进行。看来我应该允许name_bind
。我不必为 tomcat 做这个。我也期待/var/www
apache 可以毫无问题地访问它。
我在这里错过了什么吗?