我正在嘗試爲我們的團隊評估git,其中一個要求是使用HTTPS作爲傳輸方法。我一直試圖遵循git-http-backend文檔以及一些關於使用新的智能HTTP傳輸進行設置的稀少博客,但我只是沒有得到它的工作。我知道這可能是愚蠢的,但我已經絞盡腦汁,無濟於事。不要假設你有任何真正的知識,我對這個工具很陌生。權限不足通過智能HTTP推送Git共享回購
現在我可以克隆通過HTTP就好了,但是當我嘗試和推動下,客戶端獲取:
$ git push
Username:
Password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 291 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit
服務器Apache的錯誤日誌中說:
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
Apache配置:
SetEnv GIT_PROJECT_ROOT /opt/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
<Location /git>
AuthType Basic
AuthName "Private Git Access"
Require valid-user
AuthUserFile /opt/git/passwords
</Location>
顯然,我的第一個念頭是文件權限,所以我做了一個快速喬敦 - R的阿帕奇中:/ opt/git的
# ls -l /opt/git
drwxr-xr-x. 7 apache apache 4096 Aug 12 11:06 project.git
但我仍然得到同樣的錯誤。
謝謝,我非常感謝任何幫助,我可以得到這一點。
這最終成爲了SELinux阻止來自Apache的寫入目錄。 – bfos