Generating Website Statistics With Piwik, An Open-Source, Google Analytics-Like Web Analytics Tool - Page 2
Now fill in a user name for the Piwik administrator (e.g. admin), a password for that user, and the email address of that user. This is the username and password that you'll need later on to log into Piwik:
You can configure Piwik to generate reports for multiple web sites later on, but during the installation, we configure Piwik for our first (and maybe only?) web site. Fill in a name for that web site and its URL:
Click on Next afterwards:
The installation is now finished. Click on Continue to Piwik:
3 Using Piwik
Now log in with the account you've created during the installation:
This is the Piwik Dashboard (in my example it's quite empty, but on a real-life system, you should see quite a lot statistics after some time):
You can manage Piwik by clicking on the Settings link in the upper right corner. Here you can enable or disable Piwik plugins,...
..., manage users and access permissions,...
4 High-Traffic Web Sites
The Piwik reports are generated in real-time which can make the Piwik web interface a little bit slow on high-traffic web sites. Therefore you should set up a cron job (as described on http://piwik.org/docs/setup-auto-archiving/) that generates the reports once a day - the Piwik interface should then react faster again:
MAILTO="firstname.lastname@example.org" 5 0 * * * www-data /var/www/example.com/web/piwik/misc/cron/archive.sh
(This generates the reports each day at 00:05h. Make sure you use the correct user name for the web server. On Debian/Ubuntu, it's www-data, on Fedora/CentOS, it's apache.)
Make the /var/www/example.com/web/piwik/misc/cron/archive.sh file executable:
chmod 755 /var/www/example.com/web/piwik/misc/cron/archive.sh
Then run it manually to see if it throws any errors:
If you see something like this...
[root@server1 cron]# /var/www/example.com/web/piwik/misc/cron/archive.sh
/var/www/example.com/web/piwik/misc/cron/archive.sh: line 20: /usr/bin/php5: No such file or directory
... to find out where PHP is located...
[root@server1 cron]# which php
... and edit /var/www/example.com/web/piwik/misc/cron/archive.sh:
Change PHP_BIN; also adjust the PIWIK_PATH variable:
[...] PHP_BIN=/usr/bin/php PIWIK_PATH=/var/www/example.com/web/piwik/index.php [...]
again. It shouldn't throw any errors anymore.
- Piwik: http://piwik.org/