{"thread":{"id":"15591","subject":"GIT server over HTTP","startedAt":"2008-09-19T13:31:47Z","lastAt":"2008-09-19T13:31:47Z","messageCount":1,"participants":["Hinko Kocevar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91115","messageId":"48D3A9C3.8080909@cetrtapot.si","threadId":"15591","inReplyTo":null,"subject":"GIT server over HTTP","fromName":"Hinko Kocevar","fromEmail":"hinko.kocevar@cetrtapot.si","sentAt":"2008-09-19T13:31:47Z","receivedAt":"2008-09-19T13:31:47Z","isPatch":false,"sender":{"key":"hinko.kocevar@cetrtapot.si","avatar":null},"body":"Hi,\n\nI'm trying to migrate from SVN to GIT and are facing some problems with setting up public GIT repository accessible via HTTP for pull and push. I'm runnig 2.6.26 kernel on Gentoo Linux with apache 2 and git 1.5.6.4. Following the http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt I managed to get following done:\n\n1. create GIT repo in /home/hinkok/public_html:\n$ mkdir ~/public_html/gitrepo.git\n$ cd ~/public_html/gitrepo.git\n$ git --bare init\n$ sudo chown -R apache:apache .\n\n2. Create DAV entry for apache web server\n$ cat /etc/apache2/modules.d/48_mod_dav_git.conf \n<Location /~hinkok/gitrepo.git>\n\tDAV on\n#\tAuthType None\n\tAuthType Basic\n\tAuthName \"Git\"\n\tAuthUserFile /home/hinkok/passwd.git\n\tRequire valid-user\n</Location>\n\n$ htpasswd -c ~/passwd.git hinkok\n$ cat ~/passwd.git\nhinkok:t9871siBkRbaU\n$ cat ~/.netrc \nmachine localhost\nlogin hinkok\npassword hinkok\n\n3. Test GIT location\n$ curl --netrc --location http://hinkok@localhost/~hinkok/gitrepo.git/HEAD\nref: refs/heads/master\n\nFirefox also requests user auth for http://hinkok@localhost/~hinkok/gitrepo.git\n\n4. Pushing some changes to the remote repo\n$ cd /tmp\n$ mkdir gt\n$ cd gt/\n$ git init\n$ git-config remote.upload.url http://hinkok@localhost/~hinkok/gitrepo.git/    \n$ git push upload master\nerror: Cannot access URL http://hinkok@localhost/~hinkok/gitrepo.git/, return code 22\nerror: failed to push some refs to 'http://hinkok@localhost/~hinkok/gitrepo.git/'\n\n$ cat .git/config\n[core]\n\trepositoryformatversion = 0\n\tfilemode = true\n\tbare = false\n\tlogallrefupdates = true\n[remote \"upload\"]\n\turl = http://hinkok@localhost/~hinkok/gitrepo.git/\n\n $ sudo tail /var/log/apache2/error_log\n[Fri Sep 19 15:29:20 2008] [notice] Apache/2.2.9 (Unix) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8g SVN/1.5.1 PHP/5.2.6-pl6-gentoo configured -- resuming normal operations\n[Fri Sep 19 15:31:03 2008] [error] [client 127.0.0.1] client denied by server configuration: /home/hinkok/public_html/gitrepo.git/\n\nWhat am I missing here?\n\nThank you,\nHinko\n\n-- \nČETRTA POT, d.o.o., Kranj\nPlanina 3\n4000 Kranj\nSlovenia, Europe\nTel. +386 (0) 4 280 66 03\nE-mail: hinko.kocevar@cetrtapot.si\nHttp: www.cetrtapot.si\n"}]}