Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

<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

<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

share|improve this question
Can U add the logs to this? – maniat1k Nov 18 '11 at 13:42

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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