Web interface via FastCGI

Maxim Khitrov mkhitrov at gmail.com
Sun Aug 19 19:28:08 CDT 2007


Hello everyone,

I've been using mercurial for about 3 months now along with
hgwebdir.cgi script to make my repositories accessible via http. Until
now I used lighttpd as my web server, but for various reasons I
decided to switch to nginx. Unfortunately, nginx does not support CGI
scripts, only FastCGI. They have to be running and listening on an IP
or Unix socket in order for the server to use them.

I spent the entire day yesterday trying to get mercurial to run as
fastcgi. Found a bunch of Python FastCGI implementations and tried
getting them all to work. Some did, others didn't, but all were very
messy and unstable. Perhaps that's because I'm not very familiar with
Python.

What do you guys recommend for getting Mercurial to run as FastCGI? I
cannot use another web server and have nginx act as a proxy to it. I
also can't use hg serve or anything else that accepts incoming
connections via a TCP port. Reason being is that I'm running this in a
FreeBSD jail which does not have a loopback address. The only IP
servers can listen on is the public one, which means that people will
be able to bypass any security settings I configure in nginx.

I need a way to either run hgwebdir.cgi behind a FastCGI wrapper that
is listening on a unix socket, or a dedicated FastCGI implementation
of the same script. If nothing like this is available right now, I
think it definitely needs to be worked on. CGI is just way to slow if
you have many people accessing your repository.

Would greatly appreciate any suggestions.

- Max


More information about the Mercurial mailing list