I am looking to get Mercurial for everyone using hgwebdir.cgi under Apache on Mac OS X Lion.

I adopted the directions right here: http://world wide web.popitandrockit.com/2010/05/mercurial-server-on-osx-106-snow.html

It is perfect for Snow Leopard (I suppose no a person's attempted to get this done on Lion yet?) however it mostly works. Used to do result in the modification that I didn't use https since the machine under consideration is behind my company's firewall.

It states which i should have the ability to access a repository at http://servername/repository_name but that does not work. I'm able to, however, get all of the them at http://servername/hg/, where /hg may be the ScriptAlias address. And So I should have the ability to reach a repository via http://servername/hg/repository_name, but rather I am obtaining a nice Mercurial page saying

An error has occured while processing your request:

repository /Users/username/Documents/repository_name not found

Well, your directory applies and there's a legitimate repository there based on Mercurial (i.e., hg log and other alike instructions don't error out)

Around the primary page I am getting similar errors in Apache:

[(date)] [error] [client (ip address)] error accessing repository at /Users/username/Documents/repository_name

Were I to guess I'd say it had been some kind of access or permissions problem but I am not really acquainted enough with Apache or Mac OS X Lion to venture a guess regarding how you can repair it.

This indeed appears like a permissions problem. On the standard Mac OS X Apache install the net user and group are _www, and you have to make certain these have read access. Also Mercurial gripes when the hgrc file’s permissions don't match the consumer. You will find two methods to repair it:

  1. Result in the repository possessed through the Apache _www user. Whenever you type:

    ls -ld /Users/username/Documents/repository_name

    It will show _www _www within the third and 4th column. Otherwise, alter the user from the directory:

    sudo chown -R _www:_www /Users/username/Documents/repository_name

    Observe that should you change this, you shouldn't access the repository around the file system from the other user, otherwise any recently produced files will again possess the wrong permissions.

  2. Alternatively, clearly add your user towards the trusted section inside your hgweb.config:


    Within this situation you'll still have to make certain the _www user has access whatsoever. Should you type:

    ls -ld /Users/username/Documents/repository_name

    It will show something similar to drwxrwxr-- within the first column (the center rw are essential) and _www within the 4th. When the files aren't readable or writable through the group, make use of the chmod command to ensure they are:

    chmod -R go+rwX /Users/username/Documents/repository_name

    And you will alter the number of your repository to _www like so:

    sudo chown -R :_www /Users/username/Documents/repository_name

Which of these two is more suitable is dependent in your situation: if you are attempting to host your repository on the server The first is more suitable, it's simpler and a bit more secure. If you are attempting to host it in your local workstation for convenience, the second reason is simpler, because you'll be able to still access the repository out of your current user.

Observe that for ad-hoc discussing it might be simpler to simply run hg serve around the command line.

Hopefully helps.