Please, if this question is not appropriate to this list please direct me elsewhere. If it has been discussed in a previous thread, please direct me there. An initial search of the archives did not appear to show anything. I am new to Rails but not to app servers having 4 years with J2EE. The set up of a Rails app seams strait forward and I understand the MVC model. Initial test code has all worked fine. This question has to do with Rails / web server configuration. I want to run standard Apache serving the site. I want to serve the rails app on a separate port, often not even on the same machine but on the same LAN. I want to direct requests to the Rails app and have the Rails app direct a response back to the Apache server. This would have the Rails app running under either WEBrick or Mongrel. I have had good luck getting the Rails apps up and responding to requests directly. How can I get those requests / responses traveling between Apache and the Rails web server? Is there example code of such a configuration? All comments welcome john
On Mar 22, 2006, at 7:09 AM, John N. Alegre wrote:> Please, if this question is not appropriate to this list please direct > me elsewhere. If it has been discussed in a previous thread, please > direct me there. An initial search of the archives did not appear to > show anything. > > I am new to Rails but not to app servers having 4 years with J2EE. > > The set up of a Rails app seams strait forward and I understand the > MVC model. Initial test code has all worked fine. > > This question has to do with Rails / web server configuration. > > I want to run standard Apache serving the site. I want to serve the > rails app on a separate port, often not even on the same machine but > on the same LAN. I want to direct requests to the Rails app and have > the Rails app direct a response back to the Apache server. This > would have the Rails app running under either WEBrick or Mongrel. I > have had good luck getting the Rails apps up and responding to > requests directly. > > How can I get those requests / responses traveling between Apache and > the Rails web server? Is there example code of such a configuration? > > All comments welcome > john > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >John- Here are a few example apache vhosts that use the proxypass and rewrite modules to send requests on port 80 to a local or remote rails app running on a higher port. These will help you do what you want. Apache 1.3.x: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com ProxyPass / http://example.com:8000/ ProxyPassReverse / http://example.com:8000/ </VirtualHost> Apache 2.x: <VirtualHost *:80> ServerAdmin webmaster@username.tld ServerName example.com:80 ProxyRequests Off ProxyPreserveHost On RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:3000/$1 [P,L] ProxyPassReverse / http://127.0.0.1:3000/ </VirtualHost> Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com
Please, if this question is not appropriate to this list please direct me elsewhere. If it has been discussed in a previous thread, please direct me there. An initial search of the archives did not appear to show anything. I am new to Rails but not to app servers having 4 years with J2EE. The set up of a Rails app seams strait forward and I understand the MVC model. Initial test code has all worked fine. This question has to do with Rails / web server configuration. I want to run standard Apache serving the site. I want to serve the rails app on a separate port, often not even on the same machine but on the same LAN. I want to direct requests to the Rails app and have the Rails app direct a response back to the Apache server. This would have the Rails app running under either WEBrick or Mongrel. I have had good luck getting the Rails apps up and responding to requests directly. How can I get those requests / responses traveling between Apache and the Rails web server? Is there example code of such a configuration? All comments welcome john __________
Thank you Ezra, Metta john On Wednesday 22 March 2006 14:05, Ezra Zygmuntowicz wrote:> On Mar 22, 2006, at 7:09 AM, John N. Alegre wrote: > > Please, if this question is not appropriate to this list please > > direct me elsewhere. If it has been discussed in a previous > > thread, please direct me there. An initial search of the > > archives did not appear to show anything. > > > > I am new to Rails but not to app servers having 4 years with > > J2EE. > > > > The set up of a Rails app seams strait forward and I understand > > the MVC model. Initial test code has all worked fine. > > > > This question has to do with Rails / web server configuration. > > > > I want to run standard Apache serving the site. I want to serve > > the rails app on a separate port, often not even on the same > > machine but on the same LAN. I want to direct requests to the > > Rails app and have the Rails app direct a response back to the > > Apache server. This would have the Rails app running under > > either WEBrick or Mongrel. I have had good luck getting the > > Rails apps up and responding to requests directly. > > > > How can I get those requests / responses traveling between Apache > > and the Rails web server? Is there example code of such a > > configuration? > > > > All comments welcome > > john > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > John- > > Here are a few example apache vhosts that use the proxypass and > rewrite modules to send requests on port 80 to a local or remote > rails app running on a higher port. These will help you do what you > want. > > Apache 1.3.x: > > <VirtualHost *:80> > ServerName example.com > ServerAlias www.example.com > ProxyPass / http://example.com:8000/ > ProxyPassReverse / http://example.com:8000/ > </VirtualHost> > > Apache 2.x: > <VirtualHost *:80> > ServerAdmin webmaster@username.tld > ServerName example.com:80 > ProxyRequests Off > ProxyPreserveHost On > RewriteEngine On > RewriteRule ^/(.*) http://127.0.0.1:3000/$1 > [P,L] ProxyPassReverse / http://127.0.0.1:3000/ > </VirtualHost> > > > Cheers- > > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra@yakima-herald.com > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
use the apache proxy mechanism: http://httpd.apache.org/docs/1.3/mod/mod_proxy.html it will allow forward and reverse proxying between apache and webrick/lighttpd/whatever I would consider lighttpd (at least) for production mode - less memory - easier config - good security - usually faster> --- Urspr?ngliche Nachricht --- > Von: "John N. Alegre" <lists@johnalegre.net> > An: rails@lists.rubyonrails.org > Betreff: [Rails] Apache - Rails communication. > Datum: Thu, 23 Mar 2006 09:17:01 -0600 > > Please, if this question is not appropriate to this list please direct > me elsewhere. If it has been discussed in a previous thread, please > direct me there. An initial search of the archives did not appear to > show anything. > > I am new to Rails but not to app servers having 4 years with J2EE. > > The set up of a Rails app seams strait forward and I understand the > MVC model. Initial test code has all worked fine. > > This question has to do with Rails / web server configuration. > > I want to run standard Apache serving the site. I want to serve the > rails app on a separate port, often not even on the same machine but > on the same LAN. I want to direct requests to the Rails app and have > the Rails app direct a response back to the Apache server. This > would have the Rails app running under either WEBrick or Mongrel. I > have had good luck getting the Rails apps up and responding to > requests directly. > > How can I get those requests / responses traveling between Apache and > the Rails web server? Is there example code of such a configuration? > > All comments welcome > john > __________ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I found all I needed in Apache 2 was ProxyPass: # Proxy to webrick ProxyPass / http://127.0.0.1:3001/ -- Wes On 3/23/06, John N. Alegre <lists@johnalegre.net> wrote:> > Thank you Ezra, > > Metta > john > > On Wednesday 22 March 2006 14:05, Ezra Zygmuntowicz wrote: > > On Mar 22, 2006, at 7:09 AM, John N. Alegre wrote: > > > Please, if this question is not appropriate to this list please > > > direct me elsewhere. If it has been discussed in a previous > > > thread, please direct me there. An initial search of the > > > archives did not appear to show anything. > > > > > > I am new to Rails but not to app servers having 4 years with > > > J2EE. > > > > > > The set up of a Rails app seams strait forward and I understand > > > the MVC model. Initial test code has all worked fine. > > > > > > This question has to do with Rails / web server configuration. > > > > > > I want to run standard Apache serving the site. I want to serve > > > the rails app on a separate port, often not even on the same > > > machine but on the same LAN. I want to direct requests to the > > > Rails app and have the Rails app direct a response back to the > > > Apache server. This would have the Rails app running under > > > either WEBrick or Mongrel. I have had good luck getting the > > > Rails apps up and responding to requests directly. > > > > > > How can I get those requests / responses traveling between Apache > > > and the Rails web server? Is there example code of such a > > > configuration? > > > > > > All comments welcome > > > john > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > John- > > > > Here are a few example apache vhosts that use the proxypass and > > rewrite modules to send requests on port 80 to a local or remote > > rails app running on a higher port. These will help you do what you > > want. > > > > Apache 1.3.x: > > > > <VirtualHost *:80> > > ServerName example.com > > ServerAlias www.example.com > > ProxyPass / http://example.com:8000/ > > ProxyPassReverse / http://example.com:8000/ > > </VirtualHost> > > > > Apache 2.x: > > <VirtualHost *:80> > > ServerAdmin webmaster@username.tld > > ServerName example.com:80 > > ProxyRequests Off > > ProxyPreserveHost On > > RewriteEngine On > > RewriteRule ^/(.*) http://127.0.0.1:3000/$1 > > [P,L] ProxyPassReverse / http://127.0.0.1:3000/ > > </VirtualHost> > > > > > > Cheers- > > > > -Ezra Zygmuntowicz > > Yakima Herald-Republic > > WebMaster > > http://yakimaherald.com > > 509-577-7732 > > ezra@yakima-herald.com > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -- Wes -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/b48b055d/attachment-0001.html