Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to serve a CGI-based Mercurial repository from my OS X machine, but I cannot for the life of me find the hgweb.cgi file, which I assume is step 1 of the process.

My Mercurial installation comes from the OSX binary package installation, and lives in /usr/local. The python libraries are installed in /Library/Python/2.5/site-packages/mercurial:

(~): find /Library/Python/2.5/site-packages/mercurial -name hgweb*

What do I need to do do serve one or more repositories given this setup?

share|improve this question
up vote 6 down vote accepted says under "Setup a cgi script to refer to your repository"

Copy the hgweb.cgi script from the mercurial sources to /var/www/cgi-hg/index.cgi

So it appears you need to download the source version to get that file.

share|improve this answer

Under Windows (and I'm assuming other OS's as well) you have to download the source in order to get hgweb.cgi.

It would be nice if there were an easy way to set up a shared server....

share|improve this answer

I know this thread is somewhat old but I figured I'd mention that I created a guide for setting up a Mercurial server in OS X 10.6. In this guide I also provide a link to the hgweb.cgi file that works in OS X for me.

share|improve this answer
Thanks, that's a good bit of info to have. – Chris R Feb 20 '11 at 20:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.