Instructions for hosting a repository with DreamHost

masklinn masklinn at masklinn.net
Mon Dec 31 11:01:08 UTC 2007


cdwillie76 wrote:
> I just went through and added step by step instructions on how to configure a
> DreamHost account to host a mercurial repository.  The instructions can be
> found on the DreamHost Wiki at http://wiki.dreamhost.com/Mercurial.  I am
> noob with Mercurial so any feedback would be great.
> 
> Thanks
> Chris

What I did differently on y install:

* used Virtual Python on my DH account, so I changed hgwebdir.cgi's
shebang but not the sys.path.insert

* I didn't need SSH, but I did require HTTP auth for push, this can be
done very simply by creating an htpasswd file and adding the following
to your .htaccess:

    AuthUserFile /pass/to/your/htpasswd
    AuthGroupFile /dev/null
    AuthName "Mercurial Repository"
    AuthType Basic
    <Limit POST PUT DELETE>
        Require valid-user
    </Limit>

and an allow_push in each repository's hgrc.

That way, anyone can clone and pull but only authorized users can push.
Mercurial users get created on a global basis, and then you can choose
for each project/repository who gets r and who gets rw.

* Created a subdomain for the hg repositories, which means the
`RewriteBase /hg` isn't needed anymore (I prefer "http://src.domain.com"
 or "http://hg.domain.com" to "http://domain.com/hg/", but that's just
personal preference)

* Dreamhost has (or had a few months ago anyway) a special rule for the
`dispatch.cgi` file (because of rails) (basically the dispatch.cgi
processes can live longer and have higher memory limits), so I renamed
my hgwebdir.cgi to `dispatch.cgi` and redirected to that.

That's pretty much it, as far as I remember my hg install.



More information about the Mercurial mailing list