相忘于江湖

泉涸,鱼相与处于陆,相呴以湿,相濡以沫,不如相忘于江湖。《庄子.大宗师篇》

Setup Mercurial on Solaris Nevada build 59

Monday Apr 09, 2007

Solaris Nevada build 59 shipped with Mercurial 0.9.3:

 $ hg --version
Mercurial Distributed SCM (version 0.9.3)

Setup Mercurial server on it is pretty easy.

  1. $ mkdir -p /workspace/scm/hg/hgroot/g11n
  2. $ cd /workspace/scm/hg/hgroot/g11n
  3. $ hg init
  4. $ cat <<EOF > .hg/hgrc
    [web]
    contact = Simford Dong
    description = G11N Internal CWS

    style = gitweb
    allow_archive = gz zip bz2
    allow_push = *

  5. $ cp /usr/demo/mercurial/hgwebdir.cgi /workspace/scm/hg/hgroot
  6. $ chmod a+x /workspace/scm/hg/hgroot/hgwebdir.cgi
  7. $ cat <<EOF > /workspace/scm/hg/hgroot/hgweb.config
    [paths]
    g11n = g11n
  8. Append following lines into  /etc/apache2/httpd.conf
    ScriptAliasMatch  ^/hg(.*)  /workspace/scm/hg/hgroot/hgwebdir.cgi$1
    <Directory "/workspace/scm/hg/hgroot">
        Order allow,deny
        Allow from all
        AllowOverride All
        Options ExecCGI
        AddHandler cgi-script .cgi

        <Limit POST>
        AuthType Basic
        AuthName "Mercurial Repository"
        AuthUserFile /workspace/scm/hg/auth/hgpasswd
        Require valid-user
        </Limit>
    </Directory>
  9. # svcadm refresh svc:/network/http:apache2
  10. # chown -R webservd:webservd /workspace/scm/hg/hgroot/g11n

  11. Done.


NOTE: following part will enable push back over http, if you don't like this feature, you can skip them.
             - 'allow_push = *' part of step 4
             - '<Limit POST> ... </Limit>' part of step 8
             - step 10
 


[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed