From BStegmaier

Jump to: navigation, search

For tutorials and quick start guides see links below. This is just my personal configuration, change to paths etc. to your needs.

Web Repostitory

  • First you have to configure apache
webserver configuration in /etc/apache2/sites-available/
    # Rewrites URLs from .../hg/hgwebdir.cgi/project to .../hg/project
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule ^/hg(.*) /var/www/hg/hgwebdir.cgi$1
    </IfModule>

    Alias /hg /var/www/hg
    <Directory /var/www/hg>
        # Call cgi script for directory listing
        DirectoryIndex hgwebdir.cgi
        
        # we should be able to exectue cgi scripts
        AddHandler cgi-script .cgi
        Options ExecCGI
        Order allow,deny
        Allow from all

        # Pushing changes to server requires valid users, read only access for all others
        AuthType Basic
        AuthName "Mercurial repositories"
        AuthUserFile /var/www/hg/.htpasswd
        <LimitExcept GET>                                                                                                                                                                         
            Require valid-user
        </LimitExcept>
    </Directory>
 


  • list of repos and options regarding the repo index
/var/www/hg/hgweb.config
 [web]
 style = gitweb
 [paths]
 shortname = /long/path/to/repository
 shortname2 = /another/dir
 


  • If you want to publish a lot of repositories there is an easier solution: use a base directory in which you collect all repositorys (may also be symlinks).
same as above
 [collections]
 /path/to/repo/collection = /path/to/repo/collection
 


  • Sample configuration of a repository
.hg/hgrc
 [web]
 contact = e.g. name and mail
 description = what is this repository used for?
 style = gitweb
 allow_push = *
 push_ssl = false
 allow_archive = bz2 gz zip
 


Links