そのリンクを使用すると、リポジトリをいくつでも構成できます。すべてのレポ ディレクトリで、hg serve を実行する必要があります。
cd repos/repo1;
nohup hg serve -p 8000 &
cd repos/repo2;
nohup hg serve -p 8001 &
次に、nginx を介して、実行中の hg サーバーにすべてのリクエストをプロキシできます。これはあまり良い方法ではありません。この方法では、nginx の構成を手動で編集したり、hg serve を実行したりする必要があります。ただし、この方法では、リポジトリごとに個別の認証設定を作成できます。そのため、レポを顧客と共有する予定がある場合は、これを簡単に管理できます。
代わりに、mercurial で提供されている特別なスクリプト (hgwebdir) を使用できます。詳細情報は、このページで確認できます: https://www.mercurial-scm.org/wiki/PublishingRepositories#Publishing_Multiple_Repositories
更新:サーバーに mercurial バージョン 1.6 があり、実行中のレポ Web UI には、このスクリプトhgwebdir.pyを使用します。
#!/usr/bin/env python
import sys
import os
os.environ["HGENCODING"] = "UTF-8"
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
from flup.server.fcgi import WSGIServer
def make_web_app():
return hgwebdir('/home/hg/hgwebdir.conf')
WSGIServer(wsgiapplication(make_web_app),
umask=0000,
bindAddress='/home/hg/hg.sock').run()
hgwebdir.conf は次のようになります。
[web]
allow_push = some_useronly
baseurl =
push_ssl = false
[collections]
/home/hg/repos = /home/hg/repos
実行するには: nohup hgwebdir.py &, flup python モジュールが必要なので: easy_install flup
関連する nginx.conf の部分は次のとおりです。
server {
listen 80;
server_name hg.example.com;
gzip off;
include fastcgi_params;
location / {
client_max_body_size 30m;
auth_basic "Restricted Area";
auth_basic_user_file /home/hg/hg.password;
fastcgi_pass unix:/home/hg/hg.sock;
}
}