centos下解决nginx 无法连接gitlab socket

1
2
[root@liantu_61 home] # cat /etc/redhat-release 
CentOS release 6.7 (Final)

错误日志:

1
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信息:

1
2
3
4
5
6
7
[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用户组可实行权限

1
2
3
4
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/


本文转自 yawei555 51CTO博客,原文链接:http://blog.51cto.com/huwei555/1739923,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值