I am running Debian Jessie with pixel. I have a file located at /home/pi/robotAI/static/sqlite/robotAI.sqlite which I need NGINX to access. NGINX runs as www-data and normally when I run the following everything is fine
sudo chown -R pi:www-data /home/pi/robotAI/static/sqlite
sudo chmod -R 777 /home/pi/robotAI/static/sqlite
However for some reason after rebuilding my Pi this approach does not work any more. The problem appears to be that despite granting all permissions as above, the www-data user still cannot access the file. To test this I run the following as the Pi user
ls /home/pi/robotAI/static/sqlite
and I get a display of the content of the folder. However if I run the following command to test as www-data then I get permission denied.
sudo -u www-data ls /home/pi/robotAI/static/sqlite
If I check the permissions on the folder contents using the command below then I get the results shown.
ls -la /home/pi/robotAI/static/sqlite
total 136
drwxrwx--x 2 pi pi 4096 May 6 14:55 .
drwxrwxrwx 3 pi www-data 4096 May 6 14:38 ..
-rwxrwxrwx 1 pi www-data 131072 Apr 4 07:04 robotAI.sqlite
So if the file /home/pi/robotAI/static/sqlite/robotAI.sqlite is owned by the www-data group, and has permissions of rwx at the group level then why cant I access it or see it as www-data? I have rebooted several times.