Your search query "linkto:"MercurialTrac"" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message
Italiano English
Edit History Actions


Mercurial, Apache, Trac


In questa guida vedremo come configurare un repository mercurial, con Trac

Percorsi nel file system

Dobbiamo creare questa cartella:


Dentro ci sono due files:

  • hgweb.config
  • hgwebdir.cgi

Contenuto di hgweb.config

repos/ = ./repos/

style = gitweb
push_ssl = false

Contenuto di hgwebdig.cgi file che deve essere eseguibile

from mercurial import demandimport; demandimport.enable()

from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi

application = hgwebdir('hgweb.config')

e due cartelle

  • repos: contiene i repository
  • tracsupport: contiene i files con i nomi e passwords

Configurazione Apache

Il repository verrà servito su Internet con http, con il web server apache

creiamo un nuovo virtual host

<VirtualHost *:80>

    Include /etc/apache2/vhosts.d/hg.include

        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache


Ed ora il succo nella configurazione lo mettiamo nella cartella /etc/apache2/vhosts.d/ nel file hg.include


    <IfModule peruser.c>
        # this must match a Processor
        ServerEnvironment apache apache

        # these are optional - defaults to the values specified in httpd.conf
        MinSpareProcessors 4
        MaxProcessors 20

    <IfModule itk.c>
        # The userid and groupid this VirtualHost will run as
        AssignUserID apache apache

        # Optional: A separate MaxClients for the VirtualHost,
        # to limit the maximum number of processes
        MaxClientsVHost 50

        # Note that if you do not assign a user ID for your
        # VirtualHosts, none will be assigned by default,
        # ie. you'll run as root. Don't forget this!

ScriptAliasMatch        ^/hg(.*)        /var/hg/hgwebdir.cgi$1

        <Directory /var/hg>
          Options ExecCGI FollowSymLinks
          AllowOverride All
          Order allow,deny
          Allow from all

        <Location /hg/fairvpn >
           AuthUserFile /var/hg/tracsupport/yourproject.users
           AuthName "FairVPN"
           AuthType Basic
           <Limit POST PUT>
           Require valid-user