Phusion Passenger Aircraft Configuration via .htaccess

I am trying to install Redmine, and I am having problems working with Phusion Passenger with any directories other than DocumentRoot.

I set the shared directory downloaded from Redmine to ~ / www / public / entry / redmine.mysite.com / and the rest of the directories to ~ / www / app / redmine.mysite.com /.

I added the following line to the .htaccess file inside the public folder:

PassengerAppRoot ~/www/app/redmine.mysite.com 

Whenever I try to load a page, it just gives me a regular Mozilla file not found.

Any thoughts?


Additional Information:

I have a code base installed, so apache resolves any given request URI to a specific input folder, as shown below:

DocumentRoot - ~ / www / public

This folder contains the .htaccess file, which includes the following rule:

 RewriteCond ${lowercase:%{SERVER_NAME}} ^(dev\.)?(stg\.)?(www\.)?(.*)$ RewriteCond %{REQUEST_URI} !^/resource/(.*)$ RewriteRule !^entry/ entry/%4%{REQUEST_URI} 

If I create a new VirtualHost for port 3000, with DocumentRoot = ~ / www / public / entry / redmine.mysite.com /, everything will load correctly.

However, if instead I use my code-based mod_rewrite solution, I get a page error message.


If I am in redmine.mysite.com/404.html, it loads the 404.html page, which is in the correct folder.


If I change PassengerAppRoot to ~ / www / app / redmine.mysite.com / test, it tells me that the directory is not a valid root of the Ruby on Rails application.

+4
source share
1 answer

It seems like the solution was to set the RailsBaseURI to the path relative to the DocumentRoot on the server, and not to REQUEST_URI!

I thought it was referring to the actual URI string, but it turns out that it is not!

0
source

All Articles