Condensed instructions for installing Mercurial and its standard web interface on Debian. Should hold for Debian derivatives as well.

Requires Apache.


sudo aptitude install mercurial
mkdir -p ~/hg/cgi
cp /usr/share/doc/mercurial-common/examples/hgweb.cgi ~/hg/cgi


Create ~/hg/cgi/hgweb.config. My sample:

/home/daniel/hg = /home/daniel/hg

username = Daniel Andersson

allow_archive = gz, bz2
encoding = utf-8
#baseurl = /hg #Doesn't seem to make a difference when running hgweb.cgi through Apache with ScriptAlias.
#Original styles: coal || gitweb || monoblue || paper (default) || raw || spartan
#style = paperline #My style, see
#Original Pygments styles: monokai || manni || perldoc || borland || colorful (default) || default || murphy || vs || trac || tango || fruity || autumn || bw || emacs || vim || pastie || friendly || native
#See for style previews.
#pygments_style = colorful
#pygments_lexerblacklist = PerlLexer PrologLexer XmlLexer HtmlGenshiLexer #Option I added, see

highlight =

Create /etc/apache2/conf.d/hg.local:

#Hide .hg-directories (if one shares hg-controlled websites)
<Files ~ "^\.hg">
    Order allow,deny
    Deny from all
    Satisfy all

#Where the magic happens
ScriptAlias /hg "/home/daniel/hg/cgi/hgweb.cgi"


sudo service apache2 reload