Nginx refuses to read new directory in /home

centos6nginxpermissionsphp-fpm

I'm on CentOS6.6, installed "Akeneo" and all went well.

Installed into /home/pim so the actual location for nginx to use is the web directory where app.php is located.

Doing a namei on /home/pim/web/app.php shows:

f: /home/pim/web/app.php
dr-xr-xr-x root  root  /
drwxr-xr-x nginx nginx home
drwxrwxrwx nginx nginx pim
drwxr-xr-x nginx nginx web
-rwxrwxr-x nginx nginx app.php

Nginx is using:

user nginx nginx;
worker_processes  4;

And PHP-FPM is using:

listen.owner = nginx
listen.group = nginx
listen.mode = 0660

; Unix user/group of processes
user = nginx
group = nginx

Anyonan idea on why this isn't working? I've been playing for hours with the permissions now. Hope someone can point me in the right direction.

Best Answer

If SELinux is in Enforcing mode, it won't let you do that... Try changing this boolean to true:

setsebool -P httpd_enable_homedirs on

Please note, I don't recommend disabling SELinux!
There are many tools out there which can help you use SELinux to secure your system.

Related Topic