我一直在拼命尝试使用 git-http-backend 通过“smart-http”模式推动 git 工作。然而,经过数小时的测试和故障排除后,我仍然
error: Cannot access URL http://localhost/git/hello.git/, return code 22
fatal: git-http-push failed`
Run Code Online (Sandbox Code Playgroud)
我使用的是最新版本的 Ubuntu (12.04)、Apache2 (2.2.22) 和 Git (1.7.9.5) 并遵循了 Internet 上的不同教程,例如http://www.parallelsymmetry.com/howto/git .JSP。
我的 VHost 文件目前看起来像这样:
<VirtualHost *:80>
SetEnv GIT_PROJECT_ROOT /var/www/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
DocumentRoot /var/www/git
ScriptAliasMatch \
"(?x)^/(.*?)\.git/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack)$" \
/usr/lib/git-core/git-http-backend/$1/$2
<Directory /var/www/git>
Options +ExecCGI +SymLinksIfOwnerMatch -MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我已将/var/www/git
文件夹的所有权更改root.www-data
为我的测试存储库,并通过执行git config http.receivepack …