This is an old revision of the document!
Mercurial
Install
apt install mercurial uwsgi-core uwsgi-plugins-all
UWSGI
Test
Application
foobar.py
def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"]
Server
uwsgi --plugins http,python3 --http :9090 --wsgi-file foobar.py
Client
$ telnet 127.0.0.1 9090 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.0 200 OK Content-Type: text/html Hello World
Run it
CGI
/var/www/cgi-bin/hgweb.wsgi
config = b"/var/www/repos/WWW.EXAMPLE.COM/hgweb.config" import os os.environ["HGENCODING"] = "UTF-8" import cgitb; cgitb.enable() from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb application = hgweb(config)
CONF
/var/www/repos/WWW.EXAMPLE.COM/hgweb.config
hgweb.config [collections] /var/www/repos/WWW.EXAMPLE.COM = /var/www/repos/WWW.EXAMPLE.COM [web] staticurl = /static/ allow_archive = gz
RUN
http
#! /bin/bash #LOG exec 2>&1 ulimit -l unlimited ulimit -i unlimited ulimit -q unlimited ulimit -n 8192 ulimit -aH #RUN export TZ="UTC" exec /bin/uwsgi --plugins http,python3 --http :9090 --master --processes 4 --threads 2 --uid=www-data --gid=www-data --wsgi-file /var/www/cgi-bin/hgweb.wsgi