Search code examples
apacheredhatselinux

Apache 403 Forbidden error when configuring a directory outside of root directory


I'm trying to config my server to use a directory /home/imagenesDBD and I Can't get it work, I have googled a lot, and made every sample I found, but nothing is working, i Just add the following to the httpd.conf file

Alias "/imagenesDBD" "/home/imagenesDBD"
<Directory "/home/imagenesDBD">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

The directory has 0777 permission setting

Permission of execution

The context of the Directories are

context directories

I was Expecting to get this URL Working http://mydomain/imagenesDBD

and got the following error

403 - You don't have permission to access /imagenesDBD/ on this server.

You don't have permission to access /imagenesDBD/ on this server.

thanks for your help


Solution

  • The type context of /home/imagenesDBD is home_root_t.

    SELINUX will only allow type context httpd_sys_content_t.

    You should change the type of security context and it can be done by running

    $ sudo chcon -R -t httpd_sys_content_t /home/imagenesDBD
    

    Here you can found chcon manual chcon