httpd not displaying web page with SELinux turned on
Hi,
I am new to SELinux I am not sure what policy is preventing "index.html" from being read. When I have SELinux in permissive mode (setenforce 0) the web page gets rendered but when I am in enforcing mode I get a 503 return code. I am sure that I am missing something that is really obvious but any help/guidance will be greatly appreciated.
From the documentation and some web searches it sounded like I needed to allow the httpd daemon to read the files in the "/www/docs/devl/web1/htdocs" folder.
lewidws02/# ps -efZ | grep httpd
system_u:system_r:httpd_t:s0 root 5358 1 3 08:02 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
system_u:system_r:httpd_t:s0 apache 5359 5358 0 08:02 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
system_u:system_r:httpd_t:s0 apache 5360 5358 0 08:02 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
semanage fcontext -a -t httpd_sys_content_t "/www/docs/devl/web1(/.*)?"
restorecon -R -v /www/docs/devl/web1/
-rw-rw-r--. apache apache system_u:object_r:httpd_sys_content_t:s0 index.html
So I went looking to see if there was anything in the audit log that might point me in the right direction but with my limited knowledge the audit file did not tell me much.
type=AVC msg=audit(1432038673.641:34204): avc: denied { name_connect } for pid=2837 comm="httpd" dest=9030 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:tor_port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1432038673.641:34204): arch=c000003e syscall=42 success=no exit=-13 a0=9 a1=7f776c63ca50 a2=10 a3=7fffc94b069c items=0 ppid=2779 pid=2837 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=SOCKADDR msg=audit(1432038673.641:34204): saddr=02002346AC1000B70000000000000000