hg serve behind lighttpd/mod_proxy
Matt Mackall
mpm at selenic.com
Tue Apr 3 20:21:47 UTC 2007
On Tue, Apr 03, 2007 at 11:00:29AM -0500, Scott M. Ferris wrote:
> On Mon, Apr 02, 2007 at 10:47:43PM +0200, Luc Heinrich wrote:
> >
> > I'm not sure where the problem is. Mercurial ? My lighttpd config ?
> > Lighttpd itself ? Has anybody managed to get this kind of
> > configuration to work ?
>
> Do you really need to proxy to hg serve? It's pretty easy to get
> hgwebdir working with lighttpd:
>
> server.modules += ( "mod_rewrite" )
> server.modules += ( "mod_cgi" )
>
> url.rewrite-once = ( "^/hg(.*)?$" => "/hgwebdir.cgi$1",
> "^/mercurial(.*)?$" => "/hgwebdir.cgi$1" )
>
> $HTTP["url"] =~ "^/hgwebdir.cgi(.*)?$" {
> server.document-root = "/var/hg/"
> cgi.assign = ( ".cgi" => "/usr/bin/python" )
> }
>
> Copy hgwebdir.cgi to /var/hg/.
> Create an hgweb.config in /var/hg that looks something like:
>
> [collections]
> repos/ = repos/
>
> Then put your repositories in subdirectories of /var/hg/repos/.
Nice. Mind putting this on the wiki somewhere?
The advantage of doing the proxy thing is that you avoid all the CGI
start-up costs. Proxying to hg serve or using one of the FastCGI
approaches avoid this but are obviously more complicated.
Whether that extra complexity is worth the trouble for a typical
project, I don't know. The main Mercurial repo is served off a busy
Xen box that has plenty of other CGI apps running and doesn't seem to
suffer much.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list