1
votes

I want to run rails 3 and rails 2.3.8 apps on the same machine. I currently have Passenger setup with Ruby 1.9.2 for my rails 3 apps and that is working fine with Apache. I found the following at the Phusion website and am trying out the reverse proxy :

http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/

My Apache vhost file for this app looks like:

<VirtualHost *:80>
ServerName gtt
DocumentRoot /home/purvez/www/gtt/public
RailsEnv development
PassengerEnabled off
ProxyPass / http://127.0.0.1:3000
ProxyPassReverse / http://127.0.0.1:3000
</VirtualHost>

I can correctly access the app using passenger standalone using:

127.0.0.1:3000/start

but when I try to access it as :

http://gtt/start

I get a message saying:

No route matches [GET] "/start"

The Apache 'other_vhosts_access.log' however shows this entry:

testapp:80 127.0.0.1 - - [20/Oct/2011:15:27:58 +0100] "GET /start HTTP/1.1" 404 737 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

As you can see it is trying to call testapp:80 rather than gtt:80. I have both these in my /etc/hosts file and in fact gtt is BEFORE testapp!

What am I doing wrong here and how to put it right?

Edit

I am mega embarrassed! I had not enabled the site on Ubuntu and hence it was looking at the only available site i.e. testapp.

However having corrected the problem I'm still getting a 500 Error. The 'other_vhosts_access.log' entry shows:

gtt:80 127.0.0.1 - - [20/Oct/2011:18:07:30 +0100] "GET /start HTTP/1.1" 500 599 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

It's almost like the proxy to Passenger standalone is not happening and that Apache is trying to get start itself. Certainly the passenger.3000.log (i.e. standalone Passenger log) is showing no activity at all!

So having made a monumental blunder and wasted everyone's time initially I'm still in the same boat in that it looks like the Proxy is not happening!!

Anyone got any ideas?

1
Do you have a "NameVirtualHost *:80" rule in your Apache config? This is what tells Apache to use the ServerName instead of the first matching VirtualHost. - Tom
There is a NameVirtualHost *:80 entry in ports.conf as follows: NameVirtualHost *:80 Listen 80 Would that make a difference? - nexar
I believe that is correct. You may want to retag your post with Apache as well, as it appears that this isn't a Rails specific issue, but rather an issue with how Apache is routing the traffic. - Tom
@Tom good point. I have the same post on the Phusion Passenger forum but I'll include it on the Apache one too. Thanks - nexar
Hi nexar, if this question has been solved please mark it as resolved! - Joost Baaij

1 Answers

0
votes

(Posted on behalf of the question author).

Solved! I had enabled the proxy_module but I also needed to enable the proxy_http module. That finally solved the problem. Phew!!