Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined  
</VirtualHost>

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

share|improve this question
add comment

1 Answer

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
</Directory>

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
add comment

Your Answer

 
discard

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.