Инструкция по установке и настройке Mercurial через Apache (проверено на ubuntu 10.04)
sudo aptitude install mercurial
sudo aptitude install apache2 libapache2-mod-wsgi
sudo useradd hg
sudo mkdir /home/hg
sudo chown hg:hg /home/hg
sudo -u hg mkdir /home/hg/rep /home/hg/www
<VirtualHost *:80>
ServerAdmin admin@myhost.ru
ServerName hg.myhost.ru
DocumentRoot /home/hg/www/
# настройки wsgi
WSGIProcessGroup hg
WSGIDaemonProcess hg user=hg group=hg threads=2 maximum-requests=1000
# путь до скрипта, обрабатывающий wsgi
WSGIScriptAlias / /home/hg/rep/hgwebdir.wsgi
# ограничение доступа к репозиторию
<Location />
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile /home/hg/.hg.htpasswd
Require valid-user
</Location>
</VirtualHost>
sudo a2ensite mercurial
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
os.environ['HGENCODING'] = 'utf-8'
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
path = os.path.dirname(os.path.abspath(__file__))
application = hgwebdir(path+'/hgwebdir.conf')
sudo -u hg hg init /home/hg/rep/myproject
[web]
style = coal
[paths]
myproject = /home/hg/rep/myproject
htpasswd -c /home/hg/.hg.htpasswd user1
htpasswd /home/hg/.hg.htpasswd user2
sudo /etc/init.d/apache restart
[web]
allow_push = user1, user2
#allow_push = *
push_ssl = false