in Education by
I have nginx installed with PHP-FPM on a CentOS 5 box, but am struggling to get it to serve any of my files - whether PHP or not. Nginx is running as www-data:www-data, and the default "Welcome to nginx on EPEL" site (owned by root:root with 644 permissions) loads fine. The nginx configuration file has an include directive for /etc/nginx/sites-enabled/*.conf, and I have a configuration file example.com.conf, thus: server { listen 80; Virtual Host Name server_name www.example.com example.com; location / { root /home/demo/sites/example.com/public_html; index index.php index.htm index.html; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /home/demo/sites/example.com/public_html$fastcgi_script_name; include fastcgi_params; } } Despite public_html being owned by www-data:www-data with 2777 file permissions, this site fails to serve any content - [error] 4167#0: *4 open() "/home/demo/sites/example.com/public_html/index.html" failed (13: Permission denied), client: XX.XXX.XXX.XX, server: www.example.com, request: "GET /index.html HTTP/1.1", host: "www.example.com" I've found numerous other posts with users getting 403s from nginx, but most that I have seen involve either more complex setups with Ruby/Passenger (which in the past I've actually succeeded with) or are only receiving errors when the upstream PHP-FPM is involved, so they seem to be of little help. Have I done something silly here? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
One permission requirement that is often overlooked is a user needs x permissions in every parent directory of a file to access that file. Check the permissions on /, /home, /home/demo, etc. for www-data x access. My guess is that /home is probably 770 and www-data can't chdir through it to get to any subdir. If it is, try chmod o+x /home (or whatever dir is denying the request). EDIT: To easily display all the permissions on a path, you can use namei -om /path/to/check

Related questions

0 votes
    An unhandled exception of type System.AggregateException occurred in mscorlib.dll Inner Exception: {"Response status ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I'm trying to set up an Amazon Linux AMI(ami-f0091d91) and have a script that runs a copy command to copy ... what is going on? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Is there a way to get SonarQube to raise a violation if certain files/folders are found in source? ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I have deployed a Django project on Ubuntu 16.04 with Nginx and Gunicorn. I have gotten everything, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I have a fairly similar docker-compose file to what is officially provided namely version: '3' volumes: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    After a bit of a struggle to set up AWS Route53 IPv6 and my DSN (Ionos) I've managed to set up ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Here is the story: My server is a cloud server running centos, and serves a few bunch of web ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    There are two web-apps: an app for desktop browser; an app for mobile browser; Ahead of them ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    I know this is not directly a programming question, but people on stackoverflow seems to be able to answer ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I know this is not directly a programming question, but people on stackoverflow seems to be able to answer ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    I've got a Node.js powered site that I'm running on Amazon Elastic Beanstalk. My Node.js app listens on port ... to my site via HTTPS. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm looking for a way to configure Nginx to access hosted services through a subdomain of my server. Those services ... me with this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How to Install Nginx using Ansible playbook?...
asked Jul 29, 2021 in Technology by JackTerrance
0 votes
    Nginx supports __________ through round robin algorithm....
asked Mar 7, 2021 in Technology by JackTerrance
0 votes
    Nginx has become popular as it resolves...
asked Mar 7, 2021 in Technology by JackTerrance
...