SELinux

SELinux and Apache

When the server has SELinux enabled, I can't even change the location of DocumentRoot. It kept giving me error about "DocumentRoot /var/www/newdir/html does not exist".

This is because the SELinux policy will deny httpd access to any unlabelled files by default.

Instead of disabling SELinux, we could try toggle the SELinux rule settings.

To see all SELinux values, do:
root# getsebool -a

To see all the apache related SELinux boolean values, do:
root# getsebool -a | grep httpd