I wanted both Redmine and Mercurial on localhost/redmine and localhost/mercurial.

Redmine is a RoR application that runs on mod_passenger module and mercurial runs on a CGI script. I should be able to use both on a single server right?

I got Redmine to work fine. Then I followed the steps for Mercurial. Then I enabled that site.

And neiter site works. I did a2ensite those two sites and restarted Apache, but both domains now give me a 404.

Site config for redmine taken from http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www
    ServerName myservername

    RewriteEngine on
    RewriteRule   ^/$  /redmine  [R]

    <Directory /var/www/redmine>
            RailsBaseURI /redmine
            PassengerResolveSymlinksInDocumentRoot on

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

Site config for Mercurial taken from http://www.isnull.com.ar/2010/03/how-to-install-mercurial-on-debian-or.html

<VirtualHost *:80>
Servername mercurial.server
DocumentRoot /var/www/mercurial/http
ScriptAlias /cgi-bin/ /var/www/mercurial/cgi-bin/
ScriptAliasMatch ^/hg(.*) /var/www/mercurial/cgi-bin//hgwebdir.cgi$1

<Directory /var/www/mercurial/cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all

<Directory /var/www/mercurial/http>
Options FollowSymLinks
AllowOverride AuthConfig
DirectoryIndex /hg
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/error_mercurial.log
CustomLog /var/log/apache2/access_mercurial.log combined

  • Can U add the logs to this?
    – maniat1k
    Nov 18, 2011 at 13:42

1 Answer 1


Great question, the problem is that you have a different ServerName in each of your sites. Apache will look for this in the URL line, so for mercurial you'd have to go to


And for redmine you have to go to


Since you want them both to live in the same hostname, you probably just need one VirtualHost tag to define the DocumentRoot and desired ServerName, and then the aliases and such that you want under that host. This will all be simpler if it lives as one "site" configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.