cd到rails的目录,执行

 CentOS6.4安装Piwik

chmod 777 -R log

yum安装lamp
yum -y install httpd php 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
 
关闭防火墙,开启服务
/etc/init.d/iptables stop
/etc/init.d/httpd start
/etc/init.d/mysqld start
下载piwik
wget
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
‘123456’;
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
访问piwik页面,出现500错误,需要禁用mod_security这个可以忽略,后面的步骤根据自身情况填写,网站我是写的是

登陆之后,点击访客信息,发现没有数据
 
编辑默认的页面
vi /var/www/error/noindex.html
在</body>上面一行添加以下字段:
 
澳门新葡亰8455下载app,<!– 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><imgsrc=”;”
alt=”” /></p></noscript>
<!– End Piwik Code –>
 
重启httpd服务
/etc/init.d/httpd restart
 
再次访问piwik,点击访客信息,发现一条数据

chmod 777 -R tmp

Ubuntu下Piwik安装过程 
http://www.linuxidc.com/Linux/2012-02/54387.htm 

——————————– 作者在 2019-05-28 18:36:39 补充以下内容

也可以写在一行:

chmod 777 -R log/ tmp/

Piwik流量统计系统搭建(Apache2.4+Piwik+MySQL5.6+PHP5.6.14) 
http://www.linuxidc.com/Linux/2015-11/125473.htm

网站地图xml地图