Install Piwik Website access Analysis System

Source: Internet
Author: User
Tags piwik

Install Piwik Website access Analysis System

CentOS6.4 install Piwik

Install lamp in yum
Yum-y install httpd php-mysqlhttpd-manual mod_ssl mod_perl mod_auth_mysql mysql-connector-odbc mysql-devellibdbi-dbd-mysql php-gd php-xml php-mbstring php-ldap php- xmlrpc php-pearmysql-server
Yum clean all
 
Disable the firewall and enable the Service
/Etc/init. d/iptables stop
/Etc/init. d/httpd start
/Etc/init. d/mysqld start
Download piwik
Wgethttp: // builds.piwik.org/piwik.zip
Unzip piwik.zip
Cp-rf piwik/var/www/html/
 
Chown-R apache: apache/var/www/html/piwik
Chmod-R 0755/var/www/html/piwik/tmp
Chmod-R 0755/var/www/html/piwik/tmp/assets/
Chmod-R 0755/var/www/html/piwik/tmp/cache/
Chmod-R 0755/var/www/html/piwik/tmp/logs/
Chmod-R 0755/var/www/html/piwik/tmp/tcpdf/
Chmod-R 0755/var/www/html/piwik/tmp/templates_c/
 
Mysql> createdatabase piwik;
Mysql> grant all on piwik. * topiwik @ localhost identified by '123 ';
Mysql> flush privileges;
 
Chown-R apache: apache/var/www/html/piwik
Chmod-R 0755/var/www/html/piwik/tmp
Chmod-R 0755/var/www/html/piwik/tmp/assets/
Chmod-R 0755/var/www/html/piwik/tmp/cache/
Chmod-R 0755/var/www/html/piwik/tmp/logs/
Chmod-R 0755/var/www/html/piwik/tmp/tcpdf/
Chmod-R 0755/var/www/html/piwik/tmp/templates_c/
 
#### Chown-R nobody/var/www/html/piwik
When you access the piwik page, a 500 error occurs. Disable mod_security to ignore the error. Complete the following steps based on your situation. The website is written in http: // 127.0.0.1.
Http: // 192.168.2.107/piwik
After logging in, click the visitor information to find no data
 
Edit default page
Vi/var/www/error/noindex.html
Add the following fields to the </body> line:
 
<! -- Piwik -->
<Scripttype = "text/javascript">
Var_paq = _ paq | [];
_ Paq. push (['trackpageview']);
_ Paq. push (['enablelinktracking']);
(Function (){
Var u = ("https:" = document. location. protocol )? "Https": "http") + ": // 192.168.2.107/piwik /";
_ Paq. push (['settrackerurl', u + 'piwik. php']);
_ Paq. push (['setsiteid', 1]);
Var d = document, g = d. createElement ('script'), s = d. getElementsByTagName ('script') [0]; g. type = 'text/javascript ';
G. defer = true; g. async = true; g. src = u + 'piwik. js'; s. parentNode. insertBefore (g, s );
})();
</Script>
<Noscript> <p> </p> </noscript>
<! -- End Piwik Code -->
 
Restart the httpd service
/Etc/init. d/httpd restart
 
Access piwik again and click the visitor information to find a piece of data.

Install Piwik in Ubuntu

Build the Piwik Traffic Statistics System (Apache2.4 + Piwik + MySQL5.6 + PHP5.6.14)

Piwik details: click here
Piwik: click here

This article permanently updates the link address:

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.