Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
Message: 82479
BY: Aaron Reichman (areichman)
DATE: 2009-06-11 12:20
SUBJECT: Glassfish gem with Apache Virtual Host

 

I now have our web server configured to run one of our Rails apps in production mode, but I have an issue that I'm not sure how to resolve.

We are currently using a Solaris 10 server to host several non-Rails apps with Cool Stack 1.3 (we haven't migrated to Glassfish Web Stack 1.4 yet, but plan to do so in the near future). Previously, our Rails apps ran using Mongrel cluster and Apache 2.2's mod_proxy_balancer. We had two simple Apache rewrites in the http.conf file (using a Vitual Host block) to redirect traffic for our Rails app to the Mongrel cluster and that has worked well. These were basically the same rewrites documented in Dave Thomas' Agile Web Dev with Rails book.

Now, I have migrated our Rails app to the Glassfish gem and the app is successfully running on port 8080. What I can't figure out is how to reconfigure our Apache config file to redirect all traffic for this Rails app to the Glassfish gem server instance.

I attempted to add the following lines to my Apache config file (inside the same Virtual Host block that we've been using):

ProxyPass /my_rails_app http://localhost:8080
ProxyPassReverse /my_rails_app http://localhost:8080

That works somewhat, as the Rails app is now visible at its normal http://localhost/my_rails_app location. However, none of the URLs for the images within my CSS files for the Rails app are redirected. I'm guessing this is because they all use relative paths and the Apache proxy isn't detecting them and therefore isn't forwarding them.

Is there something esle I can add to the Apache config file to ensure that all requests associated with my Rails app are properly redirected to the Glassfish server?


Thread View

Thread Author Date
Glassfish gem with Apache Virtual HostAaron Reichman2009-06-11 12:20
      RE: Glassfish gem with Apache Virtual HostArun Gupta2009-06-11 12:25
            RE: Glassfish gem with Apache Virtual HostAaron Reichman2009-06-11 12:38
                  RE: Glassfish gem with Apache Virtual HostVivek Pandey2009-06-11 12:52
                        RE: Glassfish gem with Apache Virtual HostArun Gupta2009-06-11 13:53
                        RE: Glassfish gem with Apache Virtual HostAaron Reichman2009-06-11 14:25
                              RE: Glassfish gem with Apache Virtual HostVivek Pandey2009-06-11 14:34
                                    RE: Glassfish gem with Apache Virtual HostAaron Reichman2009-06-11 14:49
                                          RE: Glassfish gem with Apache Virtual HostVivek Pandey2009-06-11 14:55
                                          RE: Glassfish gem with Apache Virtual HostArun Gupta2009-06-11 14:52
                                                RE: Glassfish gem with Apache Virtual HostVivek Pandey2009-06-11 14:57
                                                      RE: Glassfish gem with Apache Virtual HostAaron Reichman2009-06-11 15:27
                                                            RE: Glassfish gem with Apache Virtual HostVivek Pandey2009-06-11 19:07

Post a followup to this message