I recently changed my web server from apache to thttpd for reasons that mostly centered on the simplicity of set up. As it turns out the cgi script that I use for mercurial, hgwebdir, expects an environment variable that apache sets but thttpd does not.
Since I was in the middle of other things and didn't want to spend much time fussing with mercurial itself I wrote a quick wrapper script that emulates the environment that mercurial expects. I decided to share it with the world, because I know that there are situations where you might be stuck running this version. (Like, if that's what your distro packages :-)
Just download the file to where your hgwebdir cgi lives, change the original script's name to hgwebdir.realcgi and the wrapper's name to hgwebdir.cgi. Then make sure both are executable by the web server, that's all there is to it. Problem fixed :-)
© Copyright 2009-2011 John Mulligan
Every blog page or article on this site is available under the CC-BY-SA license unless otherwise noted.