Forum: Ruby on Rails Ruby w/ Apache mod_proxy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
JannaB (Guest)
on 2009-06-07 17:38
(Received via mailing list)
Yes, I know this is more specifically an Apache question, but you guys
in this group know this stuff forwards & backwards it seems.

I am running the glassfish gem (in lieu of mongrel) on port 81. If I
go to http://127.0.0.1:81 I get my rails app up beautifully.
Unfortunately, I am also required to have Apache 1.3.33 running on the
production server.

So I am trying to mod_proxy the site to the url with port 81 that I
know works. Here is how I have the VirtualHost in my httpd.conf file
set up:

<VirtualHost *>
    ServerName gg
    DocumentRoot C:/jruby/rails_apps/gg
    ProxyPass /gg http://127.0.0.1:81
    ProxyPassReverse /gg http://127.0.0.1:81
    <Location /gg>
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

Ive also have unremmed:

LoadModule proxy_module modules/mod_proxy.so
-and-
AddModule mod_proxy.c

whenever I go to hit http://127.0.0.1/gg I get a 404 not found error.
I am certain my document root is correct. Can you fellows here who
have done this tell me what I am missing? Thanks, Janna B.
Frederick C. (Guest)
on 2009-06-07 17:43
(Received via mailing list)
On Jun 7, 2:37 pm, JannaB <removed_email_address@domain.invalid> wrote:

> whenever I go to hithttp://127.0.0.1/ggI get a 404 not found error.
> I am certain my document root is correct. Can you fellows here who
> have done this tell me what I am missing? Thanks, Janna B.

Who is throwing the 404 ? Is it rails telling you it doesn't have a
controller called gg ?

Fred
JannaB (Guest)
on 2009-06-07 17:51
(Received via mailing list)
Fred,

It does not appear to be -- when I check my gg/logs and gg/logs/
mongrel_ debug logs there is nothing mentioning an error here

On Jun 7, 9:42 am, Frederick C. <removed_email_address@domain.invalid>
JannaB (Guest)
on 2009-06-07 17:53
(Received via mailing list)
I must also mention I have:

LoadModule jk_module modules/mod_jk.so

in httpd.conf
JannaB (Guest)
on 2009-06-07 18:27
(Received via mailing list)
maybe you cannot do this with Apaqche 1.3.33 ?
Rick D. (Guest)
on 2009-06-07 20:29
(Received via mailing list)
On Sun, Jun 7, 2009 at 9:37 AM, JannaB<removed_email_address@domain.invalid> 
wrote:

> So I am trying to mod_proxy the site to the url with port 81 that I
> know works. Here is how I have the VirtualHost in my httpd.conf file
> set up:
>
> <VirtualHost *>
>    ServerName gg
...
> </VirtualHost>
>

...
> whenever I go to hit http://127.0.0.1/gg I get a 404 not found error.
> I am certain my document root is correct. Can you fellows here who
> have done this tell me what I am missing? Thanks, Janna B.

The servername of http://127.0.0.1/gg is not gg but 127.0.0.1 so I'm
pretty sure that the virtualhost directive isn't having any effect for
the request.

I'd try adding an entry in /etc/hosts to map gg to 127.0.0.1  and then
point the browser at

http://gg

and see what happens

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
JannaB (Guest)
on 2009-06-08 04:26
(Received via mailing list)
But that's not what I want. I need Apache listening on port 80,
routing it to the glassfish gem running on 81 (or any other port other
than 80)
Rick D. (Guest)
on 2009-06-08 04:42
(Received via mailing list)
On Sun, Jun 7, 2009 at 8:25 PM, JannaB<removed_email_address@domain.invalid> 
wrote:
>
> But that's not what I want. I need Apache listening on port 80,
> routing it to the glassfish gem running on 81 (or any other port other
> than 80)

I think you need to understand how Apache virtual hosts work,
particularly the difference between ip based and name-based vhosts:

http://httpd.apache.org/docs/2.2/vhosts/name-based.html

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
This topic is locked and can not be replied to.