| 1 |
# Apache won't be able to resolve its own hostname, so we sneak this |
| 2 |
# into the global context to silence a confusing-to-user warning on |
| 3 |
# server start. |
| 4 |
ServerName hg |
| 5 |
|
| 6 |
<VirtualHost *:80> |
| 7 |
ServerName hgweb |
| 8 |
|
| 9 |
ErrorLog ${APACHE_LOG_DIR}/error.log |
| 10 |
LogLevel warn |
| 11 |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
| 12 |
|
| 13 |
# These headers need to be set or else Anubis will |
| 14 |
# throw an "admin misconfiguration" error. |
| 15 |
RequestHeader set "X-Real-Ip" "expr=%{REMOTE_ADDR}" |
| 16 |
RequestHeader set "X-Forwarded-Proto" "expr=%{REQUEST_SCHEME}" |
| 17 |
RequestHeader set "X-Http-Version" "%{SERVER_PROTOCOL}s" |
| 18 |
|
| 19 |
ProxyPreserveHost On |
| 20 |
|
| 21 |
# Anubis is listening on this address. |
| 22 |
ProxyPass / http://[::1]:8923/ |
| 23 |
ProxyPassReverse / http://[::1]:8923/ |
| 24 |
</VirtualHost> |
| 25 |
|
| 26 |
# Sneak this directive into the global context. |
| 27 |
Listen [::1]:3001 |
| 28 |
|
| 29 |
<VirtualHost *:3001> |
| 30 |
ServerName hgweb |
| 31 |
|
| 32 |
ErrorLog ${APACHE_LOG_DIR}/error.log |
| 33 |
LogLevel warn |
| 34 |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
| 35 |
|
| 36 |
WSGIDaemonProcess hg processes=${WSGI_PROCESSES} threads=${WSGI_THREADS} maximum-requests=${WSGI_MAX_REQUESTS} user=www-data group=www-data display-name=hg-wsgi |
| 37 |
WSGIProcessGroup hg |
| 38 |
|
| 39 |
WSGIScriptAlias / /var/hg/htdocs/hgweb.wsgi |
| 40 |
|
| 41 |
<Directory /var/hg/htdocs> |
| 42 |
<Files hgweb.wsgi> |
| 43 |
Require all granted |
| 44 |
</Files> |
| 45 |
</Directory> |
| 46 |
|
| 47 |
Alias /static/ /var/hg/install/lib/python3.13/site-packages/mercurial/templates/static/ |
| 48 |
<Directory /var/hg/install/lib/python3.13/site-packages/mercurial/templates/static> |
| 49 |
Options -Indexes |
| 50 |
Require all granted |
| 51 |
</Directory> |
| 52 |
|
| 53 |
Redirect 301 /favicon.ico /static/hgicon.png |
| 54 |
</VirtualHost> |