If you install SELinux in permissive mode ( setenforce 0 command) and it works (works for me), you can run restorecon ( sudo restorecon -Rv /var/www/html/ ), which will permanently set the correct context for the files in the Apache directory since setenforce is temporary, the context for Apache is httpd_sys_content_t , and you can check its execution with the ls -Z /var/www/html/ , which outputs something like:
-rwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 index.html
If the file does not have a suitable context, you will see something like this:
drwxr-xr-x. root root unconfined_u:object_r:user_home_t:s0 tests
Hope this helps you.
PD: excuse me my english
sebasdev
source share