Forum Moderators: phranque

Message Too Old, No Replies

Apache/Passenger reverse proxy to Passenger standalone not working Opt

         

nexar

4:00 pm on Oct 20, 2011 (gmt 0)

10+ Year Member



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 :

[blog.phusion.nl...]

my apache vhost file for this app looks like:

<VirtualHost *:80>
ServerName gtt
DocumentRoot /home/purvez/www/gtt/public
RailsEnv development
PassengerEnabled off
ProxyPass / [127.0.0.1:3000...]
ProxyPassReverse / [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 :

[gtt...]

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!

Please can anyone tell me what I'm doing wrong here and how to put it
right.

Thanks in advance

Purvez

nexar

5:35 pm on Oct 20, 2011 (gmt 0)

10+ Year Member



EDIT - 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?

nexar

10:22 pm on Oct 20, 2011 (gmt 0)

10+ Year Member



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