I already went through motions of installing Mercurial server on Ubuntu. However, that left us with nasty looking URL with hgweb.cgi in it (e.g. http://192.168.0.2/hgweb.cgi/TestRepo/). Can we make it nicer?
We need to edit "/etc/apache2/sites-available/hg" in order to add two highlighted lines (I kept all other lines for clarity):
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
RewriteRule (.*) /srv/hg/cgi-bin/hgweb.cgi/$1
Next thing to do is enabling Apache's mod_rewrite module and restarting apache:
$ sudo a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.2 for ServerName
[Tue Feb 01 09:42:15 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.2 for ServerName
[Tue Feb 01 09:42:16 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
If everything went fine you should be access your repositories without hgweb.cgi, e.g. http://192.168.0.2/TestRepo/. Not a big change but it does look much better.