This page describes how to setup the hgwebdir.cgi-skript on a (unix-)server to which you only have ftp-access. See also HgWebDirStepByStep.
Prequesites
FTP-access, Python, a cgi-bin directory, but mercurial not installed on the server.
Consider using a webshell like http://phpshell.sourceforge.net/
How to do it
- make a directory '/path/to/repos' to which the webserver may write
- test whether its writeable
- by uploading test.sh
echo test > /path/to/repos/test
to your cgi-bin/ and make it executable chmod a+x test.sh.
open http://yourdomain/cgi-bin/test.sh, you'll get an server error, but that's okay
now there should be a file /path/to/repos/test
delete the file and test.sh
- by uploading test.sh
upload a recent version of mercurical to the server (e.g. the whole /usr/local/lib/python2.4/site-packages/mercurial/)
into /path/to/private_python_libs/mercurial
make a new subdir cgi-bin/hg/
change hgwebdir.cgi locally to load mercurial on the server:
# adjust python path if not a system-wide install: import sys sys.path.insert(0, "/path/to/private_python_libs/") #note that this is one dir up from mercurial
and upload it into cgi-bin/hg/}. Make it executable.
make locally a hgweb.config:
[collections] /path/to/repos/ = /path/to/repos/
and upload it to cgi-bin/hg/.
upload an existing repository myrep into /path/to/repos/myrep and make it writeable by the server.
you should now be able to access it at http://yourdomain/cgi-bin/hg/hgwebdir.cgi
probably you want to change /path/to/repos/myrep/.hg/hgrc to contain something like:
[web] contact = John Doe description = This my rep push_ssl = false allow_archive = gz zip bz2 style = gitweb #everybody may change it! allow_push = *