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: