[CentOS] Apache not liking directories outside of /var/www

Fri Jul 31 16:35:47 UTC 2009
Boris Epstein <borepstein at gmail.com>

On Fri, Jul 31, 2009 at 12:24 PM, Filipe Brandenburger
<filbranden at gmail.com> wrote:
>
> Hi,
>
> On Fri, Jul 31, 2009 at 12:17, Boris Epstein<borepstein at gmail.com> wrote:
> > Any idea why that would be?
>
> It's SELinux. Files exported by Apache must have context
> httpd_sys_content_t. You can use "ls -Z" to see the context of a
> certain file. You can use "chcon -R httpd_sys_content_t /home/test" to
> change the context of all the files in the /home/test directory,
> however that will not apply to new files created under that directory,
> in which case you have to add new rules using "semanage fcontext" (see
> the examples "man semanage" for help on how to do that).
>
> In general I would advise you to try to adapt your application so that
> the files that need to be seen by Apache are under /var/www, if you
> have that flexibility it will be simpler and have less chance of
> breaking in the future.
>
> HTH,
> Filipe
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

I found an even simplier solution - disabled SELinux. I've got a
firewall and that is plenty.

Thanks a lot, Filipe!