Server Fault is a question and answer site for system and network administrators. 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'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 ... 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>
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 to /var/www/de/example/default and 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: - There is just a directory listing instead of redmine.

Additional Info: OS: Ubuntu-server Oneiric

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
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 '12 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 '13 at 11:30

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.