日別アーカイブ: 2009年2月20日

Debian lenny 設定メモ (2) mercurial

Mercurial のサーバー設定まで

●Debian install

Debian — The Universal Operating System

5.0 Lenny が release されたので “stable” になりました。
今回は Network install より Small CDs の i386
debian-500-i386-netinst.iso を使用しています。

VirtualBox 2.1.4 を使っています。
手順は 前回 と全く同じです。

●Debian の設定

# apt-get update
# apt-get install ssh

以後 putty 経由

# apt-get install mercurial
# apt-get install hgsvn

subversion から

# svn ls https://SVNSERVER/svn/src2

# mkdir /var/lib/hg
# cd /var/lib/hg
# hgimportsvn https://SVNSERVER/svn/src2 src2
# cd src2
# hgpullsvn
# chown -R www-data.www-data src2

SSL 設定

# apt-get install ssl-cert
# make-ssl-cert generate-default-snakeoil –force-overwrite
# a2ensite default-ssl
# a2enmod ssl
# /etc/init.d/apache2 restart

Mercurial 設定

# mkdir /var/www/hg
# cd /var/www/hg
# cp /usr/share/doc/mercurial/examples/hgweb.cgi ./index.cgi
# chmod 700 index.cgi
# chown www-data.www-data index.cgi
# vi index.cgi

application = hgweb(“/var/lib/hg/src2”, “src2”)

# vi /etc/apache2/sites-available/hg-src2

Alias /hg /var/www/hg

 DirectoryIndex index.cgi
 AddHandler cgi-script .cgi
 Options ExexCGI
 AuthType Basic
 AuthName "hg repository"
 AuthUserFile /etc/apache2/hg.passwd
 Require valid-user

# htpasswd -c /etc/apache2/hg.passwd USER
# a2ensite hg-src2
# /etc/init.d/apache2 restart

# vi /etc/mercurial/hgrc

[web]
allow_push = *

●確認

Windows Mercurial-1.0.2 にて

C:\hg> hg clone https://HGSERVER/hg

参考ページ
Setting up a Mercurial CGI Server
MercurialのCGIサーバをセットアップする
hgsvn