If you set SELinux in permissive mode (command setenforce 0
) and it works (worked for me) then you can run restorecon (sudo restorecon -Rv /var/www/html/
) which set the correct context to the files in Apache directory permanently because setenforce is temporal. The context for Apache is httpd_sys_content_t
and you can verify it running the command ls -Z /var/www/html/
that outputs something like:
-rwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 index.html
In case the file does not have the right context, appear something like this:
drwxr-xr-x. root root unconfined_u:object_r:user_home_t:s0 tests
Hope it can help you.
PD: excuse me my English