Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having some troubles setting up a Git server with apache.

Here is my 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>

When I git push to http://admin@localhost/repo/myproject.git, I get this:

error: cannot lock existing info/refs
fatal: git-http-push failed

Here is a snip from my 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

I seem to be getting error 405 with MKCOL and error 500 with LOCK.

And here's my 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 (e.g. 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]

And I am entering the correct password as commands like git remote show origin which asks for the password accepts it fine.

Any ideas?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I finally found the fix, and it was such a simple one too.

This:

DavLockDB "opt/local/apache2/var/DavLock"

should've been this:

DavLockDB "/opt/local/apache2/var/DavLock"

notice the / at the beginning of the filename.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.