centos下解決nginx 無法串連gitlab socket

來源:互聯網
上載者:User

centos下解決nginx 無法串連gitlab socket
[root@liantu_61home]#cat/etc/redhat-releaseCentOSrelease6.7(Final)

錯誤記錄檔:

2016 /01/29 17:36:20[crit]27282 #0:*1connect()tounix:/home/git/gitlab/tmp/sockets/gitlab.socketfailed(13:Permissiondenied)whileconnectingtoupstream,client:192.168.xxx.xxx,server:test61.com,request:"GET/5755/my/notes?target_id=918a696a0e2340c2ee95402fa59187926edaae0c&target_type=commitHTTP/1.1",upstream:"http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/502.html",host:"test61.com",referrer:"http://test61.com/"

nginx資訊:

[root@xxx_61home] #psaux|grepnginx root272800.00.017668944?Ss17:350:00nginx:masterprocess /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx .conf www272810.00.0180961652?S17:350:00nginx:workerprocess www272820.00.0184042192?S17:350:00nginx:workerprocess www272830.00.0180961652?S17:350:00nginx:workerprocess www272840.00.0180961636?S17:350:00nginx:workerprocess root275310.00.0103304936pts /0 S+17:390:00 grep nginx

解決辦法:

nginx換用git git正常.說明許可權問題.但是伺服器必須用www使用者運行nginx.

解決思路:將nginx運行使用者www加入git組

然後賦予git使用者組可實行許可權

usermod -a-Ggitwww [root@xxx_61home] #idwww 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/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.