Posted by: Josh | April 27, 2010

Set Up Mercurial 1.5.1 on a Shared Host, Simplified

This procedure significantly removes the complexity of the set up detailed in a previous post.

  1. Download and extract this archive.
  2. Replace the ~/python/mercurial folder with an alternate build if necessary (this one is for x86_64/python2.4).
  3. Upload to your web host.
    * Note: The Mercurial CGI is designed to be run in a top-level domain or sub-domain.
  4. Ensure the following settings:
    ~/cgi-bin/hgwebdir.cgi has permissions 755 (rwxr-xr-x)
    ~/cgi-bin/hgweb.config has file paths changed relative to your server
    ~/.htaccess has AuthFile paths changed relative to your server
  5. Check to see if the site works.

To create a new repository, copy the example directory in the /cgi-bin folder to the same directory, fix it’s hgrc file in a text editor, and register this new project in hgweb.config. Configuration files:

  • hgweb.config – repository directory config
  • hgrc – per-project config

And that’s all. That was easy!

About these ads

Responses

  1. [...] Mercurial through this simple setup guide and ensure it is [...]

  2. It is awesome that you are enabling the use of hg repos on shared host. I was wondering; using the binaries you provided, would it be possible to run mercurial locally through ssh on my host? Basically, I cannot install mercurial (jailshell without gcc), but I’d still like to clone a repository to my shared host while logged in to ssh. Any ideas?

  3. The minimum your shared host will need is an installation of Python (I believe you can type “py –version” at the shell prompt in most cases to check). Then, if you SFTP the appropriate binaries to your shared host, Mercurial should be executable as “./hg”, “py hg” or something similar, which will then be invoked over SSH by a remote client. I haven’t tried this, but I remember skimming a bunch of support docs on the Mercurial home page regarding it (I’m on a very slow satellite connection right now, or I’d help you search). Let me know if you need any help with the binaries. I’m curious to see how this turns out!

  4. Unfortunately that doesn’t work. Running “python hg.py” does nothing at all, even passing in args. Looking at the script in nano, I don’t see how hg.py actually processes args…

  5. Worked for me! :) Thanks!

  6. I know it’s very old, but I’m getting

    ImportError: python/mercurial/osutil.so: failed to map segment from shared object: Operation not permitted

    What do I do?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: