apache VirtualHost ServerName hg piranha org ua Location AuthUserFile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
apache:
<VirtualHost *>
ServerName hg.piranha.org.ua
<Location />
AuthUserFile /home/dev/trac/trac.htpass
AuthName "restricted"
AuthType Basic
<Limit POST PUT>
require valid-user
</Limit>
</Location>
WSGIProcessGroup hg
WSGIDaemonProcess hg user=piranha group=www-data maximum-requests=2000
WSGIScriptAlias / /home/piranha/hg/webdir.wsgi
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
wsgi:
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
os.environ['HGENCODING'] = 'utf-8'
CONFIG = os.path.join(os.path.dirname(__file__), 'webdir.conf')
from mercurial import demandimport
demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
application = wsgiapplication(lambda: hgwebdir(CONFIG))
conf:
[paths]
/ = /home/piranha/hg/**
[web]
allow_archive = gz zip
motd = Repositories maintained by <a href="http://piranha.org.ua/">Alexander Solovyov</a>