Linux user for installation

I have a dedicated centos server running apache that will host piwik. I have root access to this server. What is the best policy for installing piwik? I’d like to host piwik at the domain ( as opposed to a users directory (

I get this error:
Piwik couldn’t write to some directories.
Try to Execute the following commands on your server:
chown -R www-data:www-data /var/www/html/piwik

However I don’t have a www-data user?


chmod -R 0755 /var/www/html/piwik/tmp/templates_c/
chmod -R 0755 /var/www/html/piwik/tmp/cache/
chmod -R 0755 /var/www/html/piwik/tmp/assets/
chmod -R 0755 /var/www/html/piwik/tmp/tcpdf/

these all fail as the directories don’t exist. Should I create these dirs ?

instead of www-data specify the web server user, under which PHP will run.

Only chmod the /tmp directory the others will be created automatically.

Thanks Matt. For reference I chown-R’ed /var/www/html/piwik as apache instead of www-data as suggested and all is good


I have the same problem in a new installation (CentOS 6).

I executed “chown -R apache:apache /var/www/html/piwik” to not avail, i.e. same error message.
I’ve also chmod’ed the other directories and still got the same list on the error page.

Any ideas?

I’ve checked and httpd is run by apache:apache