部署matomo

1.CentOS 7使用yum安装PHP5.6
1.1 删除旧php包
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64 
1.2 配置epel源
yum install -y epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
1.3 配置remi源
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
1.4 安装php5.6.x
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
1.5 安装php-fpm
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm 
1.6 配置开机启动服务
systemctl restart php-fpm
systemctl enable php-frm (error)
1.7 查看是否安装成功
ps -ef | grep php
netstat -anp | grep 9000

2. 配置php  vi /etc/php.ini
always_populate_raw_post_data = -1
cgi.fix_pathinfo = 0  #如果文件不存在,则阻止 Nginx 将请求发送到后端的 PHP-FPM 模块, 以避免遭受恶意脚本注入的攻击

3. 配置php-fpm  
3.1 创建用户matomo
groupadd matomo
useradd -g matomo matomo
3.2 vi /etc/php-fpm.d/www.conf
user = matomo
group = matomo
listen = 127.0.0.1:9001
3.3 重启php-fpm 
systemctl restart php-fpm

4.部署nginx
4.1 源码编译
./configure --prefix=/data/home/user00/app/nginx \
--conf-path=/data/home/user00/app/nginx/nginx.conf \
--pid-path=/data/home/user00/app/nginx/nginx.pid \
--with-pcre \
--with-openssl=/usr/bin/openssl
4.2 make & make install
4.3 配置对php的支持 vi nginx.conf
server/location/index,增加index.php
同时,修改如下部分
location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

5. 部署matomo
5.1 将最新的matomo解压到nginx/html
chown matomo:matomo matomo
5.2 重启
sbin/nginx -s stop
sbin/nginx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值