4

I installed nginx and all php extensions.

My web directory is /usr/share/nginx/www/

Browsing to http://localhost shows "Welcome to nginx"
Browsing to http://localhost/vnstat/ shows 403 forbidden

ls -l

-rw-r--r-- 1 root root 1631 Oct 19 15:08 24.png  
-rw-r--r-- 1 root root  383 Jul  7  2006 50x.html  
-rw-r--r-- 1 root root  151 Oct  4  2004 index.html  
drwxr-xr-x 4 root root 4096 Oct 19 15:45 vnstat  

2 Answers 2

1

nginx need read (r) permissions for the file and execute (x) permissions for the folders. So in your case it needs execute for:

/usr
/usr/share
/usr/share/nginx
/usr/share/nginx/www
/usr/share/nginx/www/vnstat

and read for:

/usr/share/nginx/www/vnstat/files

check with:

namei -l /usr/share/nginx/www/vnstat/files
0

I don't know much about nginx and vnstat, but webservers usually deliver files or script output, not directories.

Though your directory prmissions for vnstat/ look correct, your webservice is probably not allowed to read or execute the directory index (i.e. index.html or index.php) inside vnstat/. File system permissions are probably at fault, though it could be your nginx configuration. Check what is inside the vnstat directory and to make debugging easier, try calling the vnstat/index.php (or whatever the index should be) directly in your webbrowser.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .