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

Requires Apache.

Installation

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

Configuration

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

[collections]
/home/daniel/hg = /home/daniel/hg

[ui]
username = Daniel Andersson

[web]
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 http://510x.se/hg/program/hgstyle.paperline
#Original Pygments styles: monokai || manni || perldoc || borland || colorful (default) || default || murphy || vs || trac || tango || fruity || autumn || bw || emacs || vim || pastie || friendly || native
#See http://blog.favrik.com/2011/02/22/preview-all-pygments-styles-for-your-code-highlighting-needs/ for style previews.
#pygments_style = colorful
#pygments_lexerblacklist = PerlLexer PrologLexer XmlLexer HtmlGenshiLexer #Option I added, see http://510x.se/hg/program/hgext.highlight

[extensions]
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
</Files>

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

Execution

sudo service apache2 reload