How to setup http clone access

104 views
Skip to first unread message

Thomas

unread,
May 27, 2009, 12:25:48 PM5/27/09
to Gitorious
Hi,

we don't get our http:// clone link running on our private gitorious
installation. As the repository path is hashed, we have to tell apache
that git-daemon should accept git.myserver.com queries.

How do you get git-daemon listen to http://git...? I don't have any
idea how to solve this. So perhaps you can give me some default
settings?

Thanks, Thomas

Marius Mårnes Mathiesen

unread,
May 28, 2009, 2:48:10 AM5/28/09
to gito...@googlegroups.com
On 27. mai. 2009, at 18.25, Thomas wrote:

> we don't get our http:// clone link running on our private gitorious
> installation. As the repository path is hashed, we have to tell apache
> that git-daemon should accept git.myserver.com queries.

Ah, this is a little involved, should probably be in the docs :-)

The way Gitorious works now is roughly:
- If the subdomain in the HTTP request is "git", a special part of
Gitorious will handle the request, this is in the file app/metal/
git_http_cloner.rb
- This file is actually loaded on each request, and intercepts all
requests to this subdomain
- For these requests, this file queries the database for the file
system location of the repositories (the hashed paths, as you
mentioned), and then sends an X-Sendfile header without any data
- For this to work, your application server (Apache/Nginx) needs to
have x-sendfile support. For Apache use http://tn123.ath.cx/mod_xsendfile/
. You'll need to enable x-sendfile for your Rails app (the
VirtualHost), the mod_xsendfile site has instructions on this
- What actually happens is that Gitorious returns an X-Sendfile header
which gets picked up by Apache (or Nginx). Apache will then deliver
the requested file to the browser

If you're using Nginx I think x-sendfile is supported out of the box,
but the header name may be something else. Google should be able to
help...

So, to get this up and running:
1) Install and configure x-sendfile on your web server
2) Register git.<your_domain> in DNS (or host files, whatever) to
point to your Gitorious host
3) Try it out: git clone http://git.example.com/project/repo.git. If
this doesn't work, you're probably getting the X-Sendfile headers
instead of the data - in that case X-Sendfile isn't correctly set up.

That should be about it.


Regards,
- Marius

Reply all
Reply to author
Forward
0 new messages