hg serve behind lighttpd/mod_proxy

Scott M. Ferris sferris at acm.org
Tue Apr 3 11:00:29 CDT 2007


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/.

-- 
Scott M. Ferris,
sferris at acm.org 


More information about the Mercurial mailing list