我有一些麻烦build立与Apache的Git服务器。
这是我的gitrepo.conf:
DavLockDB "opt/local/apache2/var/DavLock" <Directory /opt/local/apache2/htdocs/repo> DAV On Deny from all AuthType Basic AuthName "Git repositories" AuthUserFile /etc/apache2/other/htpasswd AuthGroupFile /etc/apache2/other/htgroup-git </Directory> <Directory /opt/local/apache2/htdocs/repo/myproject.git> Allow from all Order allow,deny <Limit GET> Require group myproject-reader </Limit> <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require group myproject-writer </Limit> </Directory>
当我git push到http://admin@localhost/repo/myproject.git ,我得到这个:
error: cannot lock existing info/refs fatal: git-http-push failed
这是我access_log中的一个剪辑:
::1 - - [28/Jul/2012:19:05:52 +0100] "GET /repo/myproject.git/info/refs?service=git-receive-pack HTTP/1.1" 401 401 ::1 - admin [28/Jul/2012:19:05:52 +0100] "GET /repo/myproject.git/info/refs?service=git-receive-pack HTTP/1.1" 401 401 ::1 - admin [28/Jul/2012:19:05:55 +0100] "GET /repo/myproject.git/info/refs?service=git-receive-pack HTTP/1.1" 200 - ::1 - admin [28/Jul/2012:19:05:55 +0100] "GET /repo/myproject.git/HEAD HTTP/1.1" 200 23 ::1 - - [28/Jul/2012:19:05:57 +0100] "PROPFIND /repo/myproject.git/ HTTP/1.1" 401 401 ::1 - admin [28/Jul/2012:19:05:57 +0100] "PROPFIND /repo/myproject.git/ HTTP/1.1" 207 558 ::1 - admin [28/Jul/2012:19:05:57 +0100] "HEAD /repo/myproject.git/info/refs HTTP/1.1" 200 - ::1 - admin [28/Jul/2012:19:05:57 +0100] "HEAD /repo/myproject.git/objects/info/packs HTTP/1.1" 200 - ::1 - admin [28/Jul/2012:19:05:57 +0100] "MKCOL /repo/myproject.git/info/ HTTP/1.1" 405 249 ::1 - admin [28/Jul/2012:19:05:57 +0100] "LOCK /repo/myproject.git/info/refs HTTP/1.1" 500 535
我似乎得到与MKCOL错误405和LOCK错误500。
这是我的error_log:
[Sat Jul 28 19:05:52 2012] [error] [client ::1] user admin: authentication failure for "/repo/myproject.git/info/refs": Password Mismatch [Sat Jul 28 19:05:57 2012] [error] [client ::1] Could not LOCK /repo/myproject.git/info/refs due to a failed precondition (eg other locks). [500, #0] [Sat Jul 28 19:05:57 2012] [error] [client ::1] The locks could not be queried for verification against a possible "If:" header. [500, #0] [Sat Jul 28 19:05:57 2012] [error] [client ::1] Could not open the lock database. [500, #400] [Sat Jul 28 19:05:57 2012] [error] [client ::1] (2)No such file or directory: Could not open property database. [500, #1]
我正在input正确的密码作为像git remote show origin要求密码接受罚款的命令。
有任何想法吗?
我终于find了解决办法,也是如此简单。
这个:
DavLockDB "opt/local/apache2/var/DavLock"
应该是这样的:
DavLockDB "/opt/local/apache2/var/DavLock"
请注意在文件名的开始处的/ 。