If you are getting Apache permissions related error messages when trying to serve web content, there are a few things to try:

  1. Make sure your web content is readable by Apache. It most web server cases, Apache runs under the user apache (who woulda thought). So, we need to make sure that the apache user has read permissions to your web files.

    A quick and less secure way to do this is to chmod 775 your entire web directory.

    A slightly better way is to actually chown your web directory files to apache

    chown apache * -R

  2. SELinux enabled? SELinux provides another layer of access control to your files, but can wreak havoc on Apache. The short of it, make sure Apache has access control by "chcon-ing" your web directory.

    chcon -v --type=httpd_sys_content_t * -R
     

  3. ExecCGI configuration enabled in Apache? Apache won't run your PHP code if this option isn't enabled. And, strangely enough, this can spill out a permissions issue, which makes it really difficult to diagnose the problem.

    Options ExecCGI

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *