Your own analytics server like google analytics with Piwik

Piwik is free and open source web analytics software for your websites.It helps to give insight details of your website visitors activity. Likewise google analytics it is also capable of providing the Live website visitors information. It comes with many default features,apps and plugin which enhance the Piwik as one of the best analytics software we have in current web world. It has nice dashboard which gives clear details on first sight.

Website URL : http://piwik.org
Demo of Piwik: http://demo.piwik.org

Here in this tutorial we will install the Piwik in Ubuntu 12.04. Whereas the installation hardly takes 5 minutes if your server has all the package dependency.

Details of Server

IP address: 10.0.0.21
Operating System: Ubuntu 12.04 LTS n l
Software to install: Piwik

Follow the step by step guide to install Piwik in Ubuntu and Debian

In this tutorial,since starting I will login as root user or superuser.Hence login with superuser first.

Step 1: Login with superuser or root

sudo su -

or 

su -

Step 2: Install apache,mysql and php5 with other modules.
While installing of mysql server,it will ask to set the mysql root password. If you already have mysql server you can skip with the installation.

apt-get install apache2 mysql-server php5  php5-cli php5-gd php5-mysql php5-common

Step 3: Login into mysql-server and create a database,mysql user and grant privileges to the mysql user only for newly created database. See below how it is done.

# mysql -h localhost -u root -p

mysql> create user 'piwikuser'@'localhost' IDENTIFIED BY 'GivePassword';
 
mysql> GRANT ALL ON piwik.* TO 'piwikuser'@'localhost';
 
mysql> flush privileges;

mysql> exit;

Step 4: Download the latest package of Piwik

wget http://builds.piwik.org/latest.zip

Note: If wget command do not found then install with this command apt-get install wget

Step 5: Unzip the piwik compressed file into the /var/www .

unzip latest.zip -d /var/www

Note: If unzip command do not found then install with this command apt-get install unzip

Step 6: Create the all directories and change ownership as per given below method.Now restart the apache2 once to check if all things are fine.


mkdir -p /var/www/piwik/tmp
mkdir -p  /var/www/piwik/tmp/templates_c/
mkdir -p  /var/www/piwik/tmp/cache/
mkdir -p  /var/www/piwik/tmp/assets/
mkdir -p  /var/www/piwik/tmp/tcpdf/

chown -R www-data:www-data /var/www/piwik
chmod -R 0755 /var/www/piwik/tmp
chmod -R 0755 /var/www/piwik/tmp/templates_c/
chmod -R 0755 /var/www/piwik/tmp/cache/
chmod -R 0755 /var/www/piwik/tmp/assets/
chmod -R 0755 /var/www/piwik/tmp/tcpdf/

/etc/init.d/apache2 restart

Step 7: Now open the web browser and start the installation via web interface.

Here my server ip is 10.0.0.21 . Replace the ip address with your server IP address.And if you are try installing in your local system,you can use 127.0.0.1 or http://localhost.

Syntax http://ip-address-of-server/piwik

  • You will get the welcome dashboard, click Next
  • piwik-1
    piwik-1
  • Now it will do system check,if all things are installed and no alert is given,click Next
  • Piwik-2
    Piwik-2
  • Give database name,database server address,username and password which you have given in step 3.Select Adapter PDO_MYSQL.After filling all information ,click Next
  • Piwik-3
    Piwik-3
  • If all database information is correct,the database table will be created and in dashboard it will show status “Tables created with success”.Now click Next
  • Piwik-4
    Piwik-4
  • Now,give any name for super user login (I am using name admin),set its password and email id.Below given 2 check boxes are optional. Click Next
  • Piwik-5
    Piwik-5
  • Now it will ask you to setup your first website which you want to set piwik analytics. Fill the information as per your information, click Next
  • Piwik-6
    Piwik-6
  • After this, it will give you Java script code. This code you have to paste in your websites or blog.Click Next
  • Piwik-7
    Piwik-7
  • Yup, final words,Congratulation.The installation and setup is done. Click Continue To Piwik
  • Piwik-8
    Piwik-8
  • You will get the login page, Give Super User name and its password which you have given at the time of installation, Click Sign in
  • Piwik-9
    Piwik-9

    Below is screenshot how it looks on first time login. Explore the piwik ,visit its site ,explore more. It is very nice project and many features it has.

    Piwik-10
    Piwik-10

    To explore and for more learning about Piwik,visit its Video tutorial page.

    Leave a Comment

    This site uses Akismet to reduce spam. Learn how your comment data is processed.