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 and some others are setting up Redmine on a Debian server running Apache. Actually, I didn't do the initial setup but I can't get ahold of the guy who did right now so I'm asking here.

We are using Phusion Passenger to serve Ruby content (I guess, I'm very inexperienced with Apache) and Redmine shows up fine, but none of the static content (css, images, js) show up, and when I try to go to myurl/redmine/images or /stylesheets, I get a 404 page which I think originates from Phusion Passenger. This seems like it should be something obvious, but I can't figure out what's wrong. There was a .htaccess file in the public directory which I renamed because someone on another site had mentioned that the .htaccess file causes problems with Phusion Passenger, but even after restarting Apache I still can't see images or stylesheets.

This server is also running our main site, written in Django and running on mod_python, as well as some PHP stuff and some other Python but non-Django stuff. The relevant section of httpd.conf is as follows:

<Location "/redmine">
    PassengerEnabled on
    SetHandler none
    PassengerAppRoot /var/www/redmine/
    RailsBaseURI    /redmine
</Location>
share|improve this question

2 Answers 2

up vote 2 down vote accepted

You probably need to alias /redmine to /var/www/redmine/public, or perhaps a file-exists-conditioned local rewrite. I'm sure Google is full of "how to setup a Rails app with Passenger" guides, though, and they'll probably have more appropriate info.

share|improve this answer
    
Well, most of the stuff I've found assumes that you're only running redmine on your server, which is a stupid assumption. I'll try that though. –  Ibrahim Aug 21 '09 at 1:15
    
Actually, I guess manually adding aliases for each of the static directories worked. It seems hackish though, but working is better than nothing. –  Ibrahim Aug 21 '09 at 4:04
    
you're absolutely right - install your redmine app outside the DocumentRoot, and add a symlink to the redmine public directory from inside Apache. Its a common issue - Apache serves html/mod_xyz pages inside the document root, and cannot figure out whether it should use one module or another. Passenger doesn't work as transparently as mod_php for example, so you have to split the 2 areas apart. –  gbjbaanb May 28 '10 at 23:14

You have to specify the /public folder inside Redmine as DocumentRoot. The following configuration works fine inside a VirtualHost directive.

ServerName redmine.example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/redmine/public

For details see: http://www.modrails.com/documentation/Users%20guide%20Apache.html#%5Fdeploying%5Fa%5Fruby%5Fon%5Frails%5Fapplication

share|improve this answer

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.