i've a working Redmine-instance at /var/lib/redmine. (Redmine configuration is not the issue)

ln -s /var/lib/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
service apache2 restart

Tested with via http://here.comes.my.ip/redmine ... works fine for a test.

But i have complacations with my servername to folder mapping (rewrite) and passenger.

Here my default virtualhost (yes - everything in one vhost cause of OneSSLCertPerIP)

<VirtualHost *:80>
ServerAdmin admin@example.de
DocumentRoot /var/www
RewriteEngine on

RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} !^/cgi-bin/

# map servername to folders
RewriteCond ${lowercase:%{SERVER_NAME}} ^[a-z0-9_-]+\.[a-z]+$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^([a-z0-9_-]+)\.([a-z]+)/(.*) /var/www/$2/$1/default/$3 

RewriteCond ${lowercase:%{SERVER_NAME}} ^[.a-z0-9_-]+\.[a-z0-9_-]+\.[a-z]+$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^([.a-z0-9_-]+)\.([a-z0-9_-]+)\.([a-z]+)/(.*) /var/www/$3/$2/v+$1/$4
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined  

These RewriteRules maps example.de to /var/www/de/example/default and sub.example.de to /var/www/de/example/v+sub

So well (mapping works) so bad (call of redmine via passenger not):

ln -s /var/lib/redmine/public /var/www/de/example/v+redmine
chown -R www-data:www-data /var/www/de/example/v+redmine
service apache2 restart

[...] can be replaced with several tries to place RailsBaseURI with different folders for /redmine on different positions in /etc/apache2/sites-available/default

Result: http://redmine.example.de/ - There is just a directory listing instead of redmine.

Additional Info: OS: Ubuntu-server Oneiric

1 Answer 1


Ok found a solution, but it's not very dynamic :(

I added

<Directory /var/www/de/example/v+redmine>
    RailsBaseURI /de/example/v+redmine
    PassengerAppRoot /var/lib/redmine
    Options -MultiViews

mod_rewrite causes a little confusion about executionpaths for passenger. PassengerAppRoot will fix this. ;)

P.S.: Use just ONE way(uri) to reach your application - otherwise links will be messed up.

  • can u give a DETAILed info about how you configured REDMINE on apache2-passenger?? I am trying it since a week and i have still not been able to run it over apache2, i was also not able to make WEBrick:3000 port accessible on intranet!!
    – rathin2j
    Dec 26, 2012 at 7:14
  • sorry, i'm not capable of reconstructing my other work around redmine. It was a mixture of wild howtos.
    – 2df
    Feb 24, 2013 at 11:30

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.