Вы находитесь на странице: 1из 1

Linux Foundation’s LFCS and LFCE Certi cation Preparation Guide ($39) Get This Book   

Home About Free eBooks Deals Donate Join TecMint Linux Online Courses Subscribe Linux Hosting A-Z Linux Commands 

Linux News Linux Distro’s Interview Questions Programming  Linux Commands Linux Tricks Best Linux Tools Certi cations  Guides  Monitoring Tools 

OPEN SOURCE  0 I  TecMint :     

 BEGINNER'S GUIDE FOR LINUX 


How to Install Piwik (Alternative to Google Analytics) in Linux Start learning Linux in minutes 
by Matei Cezar | Published: November 22, 2017 | November 22, 2017

 Vi/Vim Editor BEGINNER'S GUIDE 


Learn vi/vim as a Full Text Editor 
 Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators | 4 Free Shell Scripting eBooks SHARE

This tutorial will guide you on how to install Piwik open source analytics application in CentOS 7 and in Debian +
 Linux Foundation Certi cation 
9 and Ubuntu Server 16.04 LTS edition.
4 Free Shell Scripting eBooks for Newbies and Administrators  Exam Study Guide to LFCS and LFCE

Piwik is a powerful self-hosted alternative to Google Analytics services that can be deployed on top of a LAMP 0
stack in Linux.
 

With the help of Piwik Analytics platform, which uses a small JavaScript code that must be embedded into the
0
targeted websites in between <head>...</head> html tags, you can track the number of websites visitors How to Add Linux Host to Nagios Monitoring
Server Using NRPE Plugin
and create complex reports for the analyzed websites. 
How to Install Nagios 4.3.4 on RHEL, CentOS and
Requirements 0
Fedora

LAMP stack installed in CentOS 7  Install Cacti (Network Monitoring) on


LAMP stack installed in Ubuntu RHEL/CentOS 7.x/6.x/5.x and Fedora 24-12
LAMP stack installed in Debian
Google Chrome 65 Released – Install on

Step 1: Initial Con gurations for Piwik RHEL/CentOS 7 and Fedora 27-20

How to Install Ubuntu 16.10/16.04 Alongside With


1. Before starting to install and con gure Piwik application, rst log in to server terminal and issue the
Windows 10 or 8 in Dual-Boot
following commands in order to install unzip utility in your system.

# yum install unzip zip [On CentOS/RHEL]


# apt install zip unzip [On Debian/Ubuntu]

2. Piwik platform can be deployed on top of an existing LAMP stack in Linux systems. In addition to the
standard PHP extensions installed in LAMP stack, you should also install the following PHP modues in your
system by issuing the following command.

Install PHP Modules on CentOS and RHEL

# yum install epel-release


# yum install php-mbstring php-curl php-xml php-gd php-cli php-pear php-pecl-geoip php-pdo mod_g

Install PHP Modules on Debian and Ubuntu


Linux System Administrator Bundle
# apt install php7.0-mbstring php7.0-curl php7.0-gd php7.0-xml php7.0-opcache php7.0-cli libapac with 7-Courses (96% off)

Add to Cart - $69


3. You should also install GeoIP package, GeoIP Geo location and PECL extension in your system by issuing
 Ending In: 3 days
the below command.

Computer Hacker Professional


Install GeoIP on CentOS and RHEL Certi cation Course (96% Off)

# yum install GeoIP GeoIP-devel httpd-devel Add to Cart - $59


# pecl install geoip
 Ending In: 4 days

Install GeoIP on Debian and Ubuntu


LINUX EBOOKS

# apt install geoip-bin geoip-database geoip-database-extra Introducing Learn Linux In One Week and Go
# pecl install geoip from Zero to Hero
# phpenmod geoip
RedHat RHCE/RHCSA Certi cation Preparation
Guide

4. After all required packages are installed into your system, next, issue the below command, depending on Linux Foundations LFCS/LFCE Certi cation

your Linux distribution, to open PHP con guration le and make change the following lines. Guide
Post x Mail Server Setup Guide for Linux
Ansible Setup Guide for Linux
# vi /etc/php.ini [On CentOS/RHEL]
# nano /etc/php/7.0/apache2/php.ini [On Debian/Ubuntu] Django Setup Guide for Linux
Awk Getting Started Guide for Beginners
Citrix XenServer Setup Guide for Linux
Search and change the following PHP variables as illustrated in the below line samples:

allow_url_fopen = On     
memory_limit = 64M
upload_max_file_size = 64M
Never Miss Any Linux Tutorials,
date.timezone = Europe/Bucharest
Guides, Tips and Free eBooks
Join Our Community Of 150,000+ Linux Lovers
Visit the o cial PHP time zone list in order to nd the suitable timezone according to your server geographical and get a weekly newsletter in your inbox
location.
YES! SIGN ME UP
5. Next, append the following line to PHP geoip con guration le, as shown in the below le excerpt.

# vi /etc/php.d/geoip.ini [On CentOS/RHEL]


# nano /etc/php/7.0/apache2/conf.d/20-geoip.ini [On Debian/Ubuntu]

Add the following lines to le.

extension=geoip.so
geoip.custom_directory=/var/www/html/misc

Make sure you replace /var/www/html/ directory according to the path where you will install Piwik application.

6. Finally, restart Apache daemon to re ect changes by issuing the following command.

# systemctl restart httpd [On CentOS/RHEL]


# systemctl restart apache2 [On Debian/Ubuntu]

7. Now, create Piwik MySQL database. Log in to MySQL/MariaDB console and issue the following commands
to create the database and the credentials required to access the database.

Replace the database name, user and password variables accordingly.

# mysql -u root -p
MariaDB [(none)]> create database piwik;
MariaDB [(none)]> grant all privileges on piwik.* to 'piwik' identified by 'yourpass';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

Step 3: Install Piwik on CentOS, Debian and Ubuntu


8. To install Piwik web analytics platform in your system, rst go to Piwik download page and grab the latest
zip package by executing the following command.

# wget https://builds.piwik.org/piwik.zip

9. Next, extract Piwik zip archive and copy the installation les located in piwik directory to /var/www/html/
directory by issuing the below commands.

Replace /var/www/html/ directory with your domain document root path, if that’s the case.

# unzip piwik.zip
# ls -al piwik/
# cp -rf piwik/* /var/www/html/

10. Before starting to install Piwik application via web interface, issue the following command in order to grant
Apache HTTP server with write permissions to your domain document root path.

# chown -R apache:apache /var/www/html/ [On CentOS/RHEL]


# chown -R apache:apache /var/www/html/ [On Debian/Ubuntu]

List webroot path permission by executing ls command.

# ls -al /var/www/html/

List Piwik Files

11. Now, start to install Piwik application in your system by opening and browser and visiting your server IP
address or domain name via HTTP protocol. On the rst welcome screen hit on Next button to start installation
procedure.

http://your_domain.tld/

Piwik Setup Wizard

12. In the next System Check screen, scroll down and verify if all system and PHP requirements to install Piwik
application are satis ed. When you nish hit on Next button to continue the installation procedure.

Piwik System Check

13. In the next step, add Piwik database information required by the installation script to access MySQL server,
such as database server address, Piwik database name and credentials. Use piwik_ table pre x, select
PDO/MYSQL adapter and hit on Next button to create database tables, as illustrated in the below screenshot.

Piwik Database Settings

14. On the next step, add a Piwik super user admin name, type a strong password for super user admin and an
email address and hit on Next button to continue the installation process.

Setup Piwik Admin User

15. Next, add a website domain URL to be tracked and analyzed with Piwik, the added website time zone and
specify if the added website is an e-commerce site and click on Next button to continue.

Setup Website on Piwik

16. In the next installation screen, the JavaScript tracking code that needs to be inserted to your tracked
website will be displayed in your browser. Copy the code to a le and hit on Next button to nish the installation
process.

Piwik Website Tracking Code

17. Finally, after Piwik installation completes, a “Congratulations” screen will appear in your browser. Review
the congratulations screen and click on Continue to Piwik button in order to be redirected to Piwik log in page.

Piwik Installation Completed

18. Sign in to Piwik web application with the super admin account and password con gured earlier, as
illustrated in the below screenshot, and you should be redirected to Piwik dashboard, from where you can
further start managing the application.

Piwik Admin Login

17. After logging in to Piwik web admin panel, skip the tracking code page and navigate to System ->
Geolocation -> Location Provider and click on Get Started button from GeoIP Databases section in order to
download and install the free GeoLiteCity database available for Piwik platform.

Download GeoIP Database for Piwik

That’s all! You have successfully installed Piwik web analytics platform in your system. In order to add new
websites to be tracked by the application, go to Websites -> Manage and use the Add a new website button.

After you’ve added a new website to be analyzed by Piwik, insert the JavaScript code to each page of the
tracked website in order to start the tracking and analytics process.

If You Appreciate What We Do Here On TecMint, You Should Consider:


1. Stay Connected to: Twitter | Facebook | Google Plus

2. Subscribe to our email updates: Sign Up Now

3. Get your own self-hosted blog with a Free Domain at ($3.45/month).

4. Become a Supporter - Make a contribution via PayPal

5. Support us by purchasing our premium books in PDF format.

6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Tags: Piwik Analytics

Matei Cezar View all Posts


I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years

experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

PREVIOUS STORY NEXT STORY

 How to Con gure Custom Access and Error Log Formats in How to Install Zen Cart E-commerce Shopping Store in Linux 
Nginx

 YOU MAY ALSO LIKE...

 129  28 2

VirtualBox 5.1 Released – Install on NoMachine – An Advanced Remote Zammad – An Open Source Help Desk
RHEL/CentOS/Fedora and Desktop Access Tool and Support Ticket System
Debian/Ubuntu/Linux Mint 16 OCT, 2013 25 MAY, 2018
10 JUL, 2015

GOT SOMETHING TO SAY? JOIN THE DISCUSSION.

Comment

Name * Email *

Website

Save my name, email, and website in this browser for the next time I comment.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Post Comment

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

LINUX MONITORING TOOLS LINUX INTERVIEW QUESTIONS OPEN SOURCE TOOLS

How to Use Nmap Script Engine (NSE) Scripts in Linux 15 Interview Questions on Linux “ls” Command – Part The 8 Best Free Anti-Virus Programs for Linux
1
20 Useful Commands of ‘Sysstat’ Utilities (mpstat, 11 Best Graphical Git Clients and Git Repository
pidstat, iostat and sar) for Linux Performance 10 VsFTP (Very Secure File Transfer Protocol) Viewers for Linux
Monitoring Interview Questions and Answers
3 Useful GUI and Terminal Based Linux Disk Scanning
10 Strace Commands for Troubleshooting and 10 Basic Interview Questions and Answers on Linux Tools
Debugging Linux Processes Networking – Part 1
8 Best PDF Document Viewers for Linux Systems
How to Install and Con gure Zabbix Agents on 10 Useful “Squid Proxy Server” Interview Questions
Remote Linux Systems – Part 3 and Answers in Linux 4 Best Linux Apps for Downloading Movie Subtitles

4 Useful Commandline Tools to Monitor MySQL 11 Basic Linux Interview Questions and Answers
Performance in Linux

Donate to TecMint Contact Us Advertise on TecMint Linux Services Copyright Policy Privacy Policy Career Sponsored Post


Tecmint: Linux Howtos, Tutorials & Guides © 2018. All Rights Reserved.
The material in this site cannot be republished either online or o ine, without our permission.     

Вам также может понравиться