簡単にまとめると(間違いあるかも)
- つまずいたところ
- レポジトリのパーミッションの設定がいまだに良く分からない
- internal server error 500とか出るときはパーミッションが間違っているかもしれない
- (現在の設定は)
chown hg.hg -R レポジトリのディレクトリ
chmod 775 -R レポジトリのディレクトリ
ソースを持ってきて展開 (mercurial-1.3.1.tar.gz)
/home/www/cgi-hg/を作る
- hgwebdir.cgi
- ソースからhgwebdir.cgiを/home/www/cgi-hg/にコピー
- #がついているところは
- #をはずして以下に編集
import sys
sys.path.insert(0, "/usr/lib64/python2.4/site-packages/mercurial/")
" "この中はmercurialがインストールされているディレクトリ
import os
os.environ["HGENCODING"] = "UTF-8"
application = hgwebdir('hgweb.[[config]]')
wsgicgi.launch(application)
- hgweb.conf
- /home/www/cgi-hg/にhgweb.confを作成
[collections]
repos/ = repos/
- reposはレポジトリを入れておくディレクトリ
- /home/www/cgi-hg/reposとするならこの設定でok
- Apacheの設定
- この設定はpushするときのみユーザー認証をかける
/etc/httpd/conf.d/hg.confを作って以下を書く
ScriptAliasMatch ^/hg(.*) /var/www/cgi-hg/hgwebdir.cgi$1
<Directory /var/www/cgi-hg/>
Options ExecCGI FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "My space"
AuthUserFile "/etc/httpd/.hgpasswd"
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
DirectoryIndex hgwebdir.cgi
AddHandler cgi-script .cgi
Order allow,deny
Allow from all
</Directory>
AuthUserFile "/etc/httpd/.hgpasswd"にはパスワードファイルを置く
htpasswd -c /etc/httpd/.hgpasswd ユーザー名
- repos
- この時点でURL/hgにアクセスするとMercurial Repositoriesと書かれたものがある
- reposにレポジトリを作ってみる
cd /home/www/cgi-hg/
mkdir test; cd test
hg init
- .hg/hgrc
- サーバとしてレポジトリを公開する場合は
- .hgの中にhgrcを作って
[web]
push_ssl = false
allow_push = *
- と書かないとダメ
- ローカル側にはいらない
これでレポジトリが追加されたのが分かるはず
最終更新:2009年12月04日 20:46