Difference between revisions of "Install Piwik on CentOS 5"

From CSLabsWiki
(Created Piwik installation page)
 
(Finished tutorial)
 
Line 1: Line 1:
 
This page summarizes how to perform a basic installation of Piwik on CentOS 5. This tutorial assumes you have root/sudo access.
 
This page summarizes how to perform a basic installation of Piwik on CentOS 5. This tutorial assumes you have root/sudo access.
 
Note: under construction, will finish soon! --[[User:Deanejm|Deanejm]] 15:51, 28 March 2011 (EDT)
 
   
 
==Unpacking the Files==
 
==Unpacking the Files==
Line 12: Line 10:
 
**<code>chgrp -R apache piwik/</code>
 
**<code>chgrp -R apache piwik/</code>
 
*Install the following packages: php-json, php-dom, php-gd, and php-mbstring
 
*Install the following packages: php-json, php-dom, php-gd, and php-mbstring
  +
*Configure Apache to recognize the piwik directory
  +
**Open /etc/httpd/conf.d/piwik.conf
  +
**Paste in the following:
  +
Alias /piwik /var/www/piwik/
  +
  +
<Directory /var/www/piwik/>
  +
Options ExecCGI
  +
Order allow,deny
  +
Allow from all
  +
AddType application/x-httpd-php .php
  +
php_flag magic_quotes_gpc on
  +
php_flag track_vars on
  +
</Directory>
 
*Restart httpd
 
*Restart httpd
 
**<code>/etc/init.d/httpd restart</code>
 
**<code>/etc/init.d/httpd restart</code>
Line 21: Line 32:
 
**<code>GRANT ALL ON piwik.* TO 'piwik'@'localhost';</code>
 
**<code>GRANT ALL ON piwik.* TO 'piwik'@'localhost';</code>
 
*Exit MySQL
 
*Exit MySQL
  +
  +
==Install Piwik==
  +
*[http://piwik.org/docs/installation/ Piwik Installation Guide]
  +
*Navigate to the location where Piwik is installed with a web browser (for example, netstat.cslabs.clarkson.edu/piwik)
  +
*Follow the prompts in the installation screens
  +
**Note: the php time zone detection support will give a warning; this is OK as time zones can be set manually
  +
**For the database setup, use the following:
  +
***database server: localhost
  +
***login: piwik
  +
***password: whatever you set while configuring MySQL
  +
***database name: piwik
  +
***table prefix: piwik_
  +
***adapter: PDO_MYSQL
  +
*The create a super user step of installation creates the administrator for piwik
  +
*Set up the first website during installation and paste the tracking code into the page (note: each site you monitor will need different tracking code)
  +
*To set forced SSL during login (note: forcing SSL via Apache configuration files will break Piwik's visitor tracking):
  +
**Open /var/www/piwik/config/config.ini.php
  +
**Under the username, email, and password for the superuser, add the following:
  +
[General]
  +
force_ssl_login=1

Latest revision as of 18:18, 28 March 2011

This page summarizes how to perform a basic installation of Piwik on CentOS 5. This tutorial assumes you have root/sudo access.

Unpacking the Files

  • Navigate to /var/www
  • Download and unpack the files
  • Give Piwik Permission to Access its Folder
    • chmod -R g+w piwik/
    • chgrp -R apache piwik/
  • Install the following packages: php-json, php-dom, php-gd, and php-mbstring
  • Configure Apache to recognize the piwik directory
    • Open /etc/httpd/conf.d/piwik.conf
    • Paste in the following:
Alias /piwik /var/www/piwik/

<Directory /var/www/piwik/>
  Options ExecCGI
  Order allow,deny
  Allow from all
  AddType application/x-httpd-php .php
  php_flag magic_quotes_gpc on
  php_flag track_vars on
</Directory>
  • Restart httpd
    • /etc/init.d/httpd restart

Configure MySQL for Piwik Installation

  • Create the piwik database, user, and allow the piwik user to access the database
    • CREATE DATABASE piwik;
    • CREATE USER 'piwik'@'localhost' IDENTIFIED BY 'insert password here';
    • GRANT ALL ON piwik.* TO 'piwik'@'localhost';
  • Exit MySQL

Install Piwik

  • Piwik Installation Guide
  • Navigate to the location where Piwik is installed with a web browser (for example, netstat.cslabs.clarkson.edu/piwik)
  • Follow the prompts in the installation screens
    • Note: the php time zone detection support will give a warning; this is OK as time zones can be set manually
    • For the database setup, use the following:
      • database server: localhost
      • login: piwik
      • password: whatever you set while configuring MySQL
      • database name: piwik
      • table prefix: piwik_
      • adapter: PDO_MYSQL
  • The create a super user step of installation creates the administrator for piwik
  • Set up the first website during installation and paste the tracking code into the page (note: each site you monitor will need different tracking code)
  • To set forced SSL during login (note: forcing SSL via Apache configuration files will break Piwik's visitor tracking):
    • Open /var/www/piwik/config/config.ini.php
    • Under the username, email, and password for the superuser, add the following:
[General]
force_ssl_login=1