在服务器上搭建zabbix监控,发现配置好后的web页面部分功能无法使用,用鼠标点击无反应,通过Chrome控制台看到如下错误:ERR_INCOMPLETE_CHUNKED_ENCODING。
看了下nginx/logs/error.log下日志:
[html]
view plain copy
- open() "/aliyun/server/nginx/fastcgi_temp/1/02/0000000021" failed (13: Permission denied) while reading upstream, client: x.x.x.x, server: x.x.x.x, request: "GET /blog/wp-admin/load-styles.php?c=1&dir=ltr&load=dashicons,admin-bar,wp-admin,buttons,wp-auth-check&ver=4.1.1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xx.xx.xx.xx", referrer: "http://x.x.x.x/blog/wp-admin/"
搜索了下, 发现nginx目录下fastcgi_temp属于nobody用户和用户组。
[html] view plain copy
- drwx------ 12 nobodynobody4096 Mar 14 18:24 fastcgi_temp
再看php-fpm配置文件:
[html] view plain copy
- #vi /etc/php-fpm.d/www.conf
- ; Unix user/group of processes
- ; Note: The user is mandatory. If the group is not set, the default user's group
- ; will be used.
- ; RPM: apache Choosed to be able to access some dir as httpd
- ; user = nobody
- user=www
- ; RPM: Keep a group allowed to write in log dir.
- ; group = nobody
- group=www
用户和用户组已经改成了www。将fastcgi_temp及子目录改为www。如下: [html] view plain copy
- #chown -R www:www fastcgi_temp
- #ls -al
- drwx------ 12 wwwwww4096 Mar 14 18:24 fastcgi_temp
再次访问wordpress,一切正常!
推荐阅读
- 企业实战|Linux 五种IO模型详细图解
- Linux|关于CentOS7联网,祝你一臂之力
- 问题记录-服务端|JeecgBoot启动提示(QRTZ_LOCKS表不存在)
- 原创|centos7.2 安装和启动docker
- centos|搭建Git服务器
- docker容器|docker 启动container的时候出现iptables failed
- Linux|RedHat/CentOS挂载LVM磁盘
- linux|CentOS7相关操作(记录,更新)
- Centos7 安装docker-compose
- centOS|服务器被挂码-门罗币挖矿程序