CentOS 7 installs open source data statistics Piwik

Source: Internet
Author: User
Tags piwik


1, about Piwik


Piwik is a set of open source Web site access statistics system based on Php5+mysql Technology, formerly known as Phpmyvisites. Piwik can give you detailed statistics, such as the number of visitors to the page, the most visited pages, search engine keywords and other traffic analysis functions. In addition, it incorporates plug-in extensions and an open API architecture that allows users to create more functionality based on their own actual needs.
The goal is to create a Google analytics system.



In general, such as Baidu Statistics, Google Analystic, to cope with statistical analysis of the website is enough.
But there is no need to be customized. Because the data are in the system above the others.
In general, the Piwik is to put statistics on their own machines, providing the future of their own processing of data, but the cost will certainly be higher.


2, installation


Ash is often simple, first of all need a nginx+fastcgi environment.
Create the TMP directory and assign permissions, assuming Piwik is placed under the/data/piwik directory.


 
 
mkdir -p /data/piwik/tmp/cache/tracker/
chmod 777 /data/piwik/tmp/ -R
touch /data/piwik/config/config.ini.php
chmod 777 /data/piwik/config/config.ini.php


Create a MySQL database. You need to install the database:


yum install -y mariadb-server
systemctl start mariadb.service
systemctl enable mariadb.service
#Then configure mariadb admin password.
/ usr / bin / mysql_secure_installation


You must have a MySQL server installed, either using a local database or using a remote database.
Otherwise you will get an error: (maybe PHP needs to rely on the MySQL development package, not very familiar with)


SQLSTATE[HY000] [2002tolocalthrough socket ‘/var/lib/mysql/mysql.sock‘ (2)


Create user after


mysql> CREATE DATABASE piwik DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON piwik.* TO [email protected]"%" IDENTIFIED BY "piwik";
Query OK, 0 rows affected (0.24 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)


Configure the Nginx module and enter the installation interface:





Set up the database, either natively or remotely. Prefixes can be added, not incremented.

Database established successfully

Set Admin Account

Create your own site.

The Official Statistics Demo
http://demo.piwik.org/


3, Summary


The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/47146525 not allowed to reprint without the Bo master.



It encountered a bug that reported a database error.
https://github.com/piwik/piwik/issues/8304
Add yourself to the line.


Unknown column ‘log_visit.config_os’ in ‘field list’ "

solve:
mysql> ALTER TABLE piwik_log_visit ADD COLUMN config_os VARCHAR (20);
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0

mysql> ALTER TABLE piwik_log_visit ADD COLUMN config_browser_name VARCHAR (20);
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0 


Quickly set up a Web page analysis system, is very good.
The function is very powerful. The required features are basically there.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.



CentOS 7 installs open source data statistics Piwik


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.