Mercurial, Apache, Trac
QUESTA PAGINA E' ANCORA UNA BOZZA
In questa guida vedremo come configurare un repository mercurial, con Trac
Percorsi nel file system
Dobbiamo creare questa cartella:
/var/hg
Dentro ci sono due files:
- hgweb.config
- hgwebdir.cgi
Contenuto di hgweb.config
[collections] repos/ = ./repos/ [web] 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') wsgicgi.launch(application)
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 </IfModule> </VirtualHost>
Ed ora il succo nella configurazione lo mettiamo nella cartella /etc/apache2/vhosts.d/ nel file hg.include
ServerName hg.tuonome.it <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> <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! </IfModule> ScriptAliasMatch ^/hg(.*) /var/hg/hgwebdir.cgi$1 <Directory /var/hg> Options ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Location /hg/fairvpn > AuthUserFile /var/hg/tracsupport/yourproject.users AuthName "FairVPN" AuthType Basic <Limit POST PUT> Require valid-user </Limit> </Location>