Hi,
I wanted to do my users a favor by replacing GoogleAnalytics with Piwik, but now I’ve hit a road block:
-
I have installed the Piwik files
-
I try to start the configuration process, by visiting the piwik.php page
-
I get:
Piwik couldn’t write to some directories (running as user ‘nobody’).
Try to Execute the following commands on your server, to allow Write access on these directories:chown -R www-data:www-data /home/<some_user>/releases/20140116095613/public/analytics
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/assets/
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/cache/
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/logs/
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/tcpdf/
chmod -R 0755 /home/<some_user>/releases/20140116095613/public/analytics/tmp/templates_c/
I’m using Nginx as a server and in the Nginx conf file, I explicitely set both User and Group to ‘www-data’. So:
$ ps -elf | grep nginx
…gives:
1 S root 1274 1 0 80 0 - 12847 sigsus 14:52 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
5 S www-data 1281 1274 0 80 0 - 13116 ep_pol 14:52 ? 00:00:00 nginx: worker process
5 S www-data 1282 1274 0 80 0 - 13116 ep_pol 14:52 ? 00:00:00 nginx: worker process
5 S www-data 1283 1274 0 80 0 - 13116 ep_pol 14:52 ? 00:00:00 nginx: worker process
5 S www-data 1284 1274 0 80 0 - 13116 ep_pol 14:52 ? 00:00:00 nginx: worker process
5 S www-data 1287 1274 0 80 0 - 12847 ep_pol 14:52 ? 00:00:00 nginx: cache manager process
5 S www-data 1288 1274 0 80 0 - 12847 ep_pol 14:52 ? 00:00:00 nginx: cache loader process
0 S root 2127 1987 0 80 0 - 2364 pipe_w 14:53 pts/2 00:00:00 grep --color=auto nginx
Checking the permissions for Piwik’s /tmp/ folder:
$ ls -l /home/<some_user>/releases/20140116095613/public/analytics/tmp
…gives:
drwxrwxrwx 2 www-data www-data 4096 Jan 16 12:10 assets
drwxrwxrwx 2 www-data www-data 4096 Jan 16 12:10 cache
drwxrwxrwx 2 www-data www-data 4096 Jan 16 12:10 logs
drwxrwxrwx 2 www-data www-data 4096 Jan 16 12:10 tcpdf
drwxrwxrwx 2 www-data www-data 4096 Jan 16 12:10 templates_c
So, to me, www-data has clearly all permissions for /temp/ it needs.
So:
- Why does Piwik say it’s run as user ‘nobody’: “Piwik couldn’t write to some directories (running as user ‘nobody’).”
- Why does Piwik not let www-data write to these folders?
Thank you very much for any help with this!
EDIT :
Problem solved. A caching mechanism apparently didn’t let the new values (new user/group settings from Nginx) through.