git/list[1] front-page[2] threads[3] people[4] search[5] about
 

GIT server over HTTP

From
HKHinko Kocevar <hinko.kocevar@cetrtapot.si>
Date
Sep 19, 2008, 13:31 UTC
Message-ID
<48D3A9C3.8080909@cetrtapot.si>
Hi,
I'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:
1. create GIT repo in /home/hinkok/public_html:
$ mkdir ~/public_html/gitrepo.git
$ cd ~/public_html/gitrepo.git
$ git --bare init
$ sudo chown -R apache:apache .
2. Create DAV entry for apache web server
$ cat /etc/apache2/modules.d/48_mod_dav_git.conf 
<Location /~hinkok/gitrepo.git>
	DAV on
#	AuthType None
	AuthType Basic
	AuthName "Git"
	AuthUserFile /home/hinkok/passwd.git
	Require valid-user
</Location>

$ htpasswd -c ~/passwd.git hinkok $ cat ~/passwd.git hinkok:t9871siBkRbaU $ cat ~/.netrc machine localhost login hinkok password hinkok

3. Test GIT location
$ curl --netrc --location http://hinkok@localhost/~hinkok/gitrepo.git/HEAD
ref: refs/heads/master
Firefox also requests user auth for http://hinkok@localhost/~hinkok/gitrepo.git
4. Pushing some changes to the remote repo
$ cd /tmp
$ mkdir gt
$ cd gt/
$ git init
$ git-config remote.upload.url http://hinkok@localhost/~hinkok/gitrepo.git/    
$ git push upload master
error: Cannot access URL http://hinkok@localhost/~hinkok/gitrepo.git/, return code 22
error: failed to push some refs to 'http://hinkok@localhost/~hinkok/gitrepo.git/'
$ cat .git/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "upload"]
	url = http://hinkok@localhost/~hinkok/gitrepo.git/
 $ sudo tail /var/log/apache2/error_log
[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
[Fri Sep 19 15:31:03 2008] [error] [client 127.0.0.1] client denied by server configuration: /home/hinkok/public_html/gitrepo.git/
What am I missing here?

Thank you, Hinko

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@cetrtapot.si
Http: www.cetrtapot.si
Message 1 of 1 in “GIT server over HTTP”
  1. Hinko KocevarSep 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.