centos下解决nginx 无法连接gitlab socket
2016-01-29 17:47
615 查看
[root@liantu_61 home]# cat /etc/redhat-release CentOS release 6.7 (Final)错误日志:
2016/01/29 17:36:20 [crit] 27282#0: *1 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied) while connecting to upstream, client: 192.168.xxx.xxx, server: test61.com, request: "GET /5755/my/notes?target_id=918a696a0e2340c2ee95402fa59187926edaae0c&target_type=commit HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/502.html", host: "test61.com", referrer: "http://test61.com/"nginx信息:
[root@xxx_61 home]# ps aux|grep nginx root 27280 0.0 0.0 17668 944 ? Ss 17:35 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf www 27281 0.0 0.0 18096 1652 ? S 17:35 0:00 nginx: worker process www 27282 0.0 0.0 18404 2192 ? S 17:35 0:00 nginx: worker process www 27283 0.0 0.0 18096 1652 ? S 17:35 0:00 nginx: worker process www 27284 0.0 0.0 18096 1636 ? S 17:35 0:00 nginx: worker process root 27531 0.0 0.0 103304 936 pts/0 S+ 17:39 0:00 grep nginx解决办法:
nginx换用git git正常.说明权限问题.但是服务器必须用www用户运行nginx.
解决思路:将nginx运行用户www加入git组
然后赋予git用户组可实行权限
usermod -a -G git www [root@xxx_61 home]# id www uid=501(www) gid=501(www) groups=501(www),503(git) chmod g+rx /home/git/参考信息:http://axilleas.me/en/blog/2013/selinux-policy-for-nginx-and-gitlab-unix-socket-in-fedora-19/
相关文章推荐
- Nginx配置文件nginx.conf中文详解
- Nginx基础
- LNMP环境搭建-nginx
- Nginx+Varnish 实现动静分离,为服务器分流,降低服务器负载
- Nginx高并发配置思路(轻松应对1万并发量)
- Nginx基础入门之gzip常用配置项说明
- nginx添加第三方模块
- Apache和Nginx对比
- Nginx环境搭建步骤
- nginx 访问 php 502
- nginx 配置文件
- nginx 启动脚本
- nginx中的ngx_cdecl
- nginx.conf中配置laravel框架站点
- 配置Nginx服务器展示随机首页与空白图片的方法
- LNMP(linux+nginx+mysql+php)服务器环境配置
- 003.安装nginx(lnmp)
- nginx回炉-第0篇-写在前面的话
- Nginx高级使用
- Nginx基本使用