John Ivanoff
2006-Jul-07 16:44 UTC
[Rails] mongrel/win32/apache2 link modification question.
I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 pc, by folowing the ''Serving Multiple Rails Applications on Windows with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) the question I have is why is why is http://localhost/myapp/ addded to the front of all my links and how can I stop it? origanal link using webrick /employees/edit/1214 now it''s http://localhost/myapp//employees/edit/1214 John Ivanoff
John Ivanoff
2006-Jul-07 19:29 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
answer to my problem... a,?address (:host) Address to bind to when listening for connections. * Default: 0.0.0.0 (every interface) thanks for the documentation/site zed. On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote:> I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 > pc, by folowing the ''Serving Multiple Rails Applications on Windows > with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) > > the question I have is why is why is http://localhost/myapp/ addded to > the front of all my links and how can I stop it? > > origanal link using webrick /employees/edit/1214 > now it''s > http://localhost/myapp//employees/edit/1214 > > > John Ivanoff >
Brian Hogan
2006-Jul-07 19:43 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
John: I''m the author of that article. Would you please elaborate more on your problem? Are you using the reverse_proxy_fix plugin? On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote:> > answer to my problem... > > a,?address (:host) > Address to bind to when listening for connections. > * Default: 0.0.0.0 (every interface) > > thanks for the documentation/site zed. > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 > > pc, by folowing the ''Serving Multiple Rails Applications on Windows > > with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) > > > > the question I have is why is why is http://localhost/myapp/ addded to > > the front of all my links and how can I stop it? > > > > origanal link using webrick /employees/edit/1214 > > now it''s > > http://localhost/myapp//employees/edit/1214 > > > > > > John Ivanoff > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060707/54e25fe1/attachment.html
John Ivanoff
2006-Jul-07 20:09 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
I am using the reverse_proxy_fix plugin. my web server is a 2k box we''ll call ''webserver''. when I accessed http://webserver/myapp/controller locally the page shows up, but the links point to http://localhost/myapp//controller/action/id (this is from the source from the displayed page) my stylesheet was pionting to http://localhost/myapp//stylesheets/scaffold.css?1147879980 which will work as long as i''m on webserver. If I went to another pc, say ''winxp'' and I went to ''http://webserver/myapp/controller'' the page displays, but the links don''t ''work'' because it is trying to access localhost. follow? so I stoped and removed the mongrel sevice then I reinstalled using this. mongrel_rails service::install -N intranet -c c:\web\intranet -p 4001 -e development -a 192.168.10.246 (it''s an internal server) and started the service. it''s running. Now I go to http://webserver/myapp/controller all the links go to /controller/action/id (from web page source). so now the links don''t work because the app name (myapp) is not in the url path. do I need to do something with route? I would actually like hide the application from the URL. so instead of http://server/myapp/controller it would be http://server/controller I''m not sure If I confused you or made it more clear thanks. john On 7/7/06, Brian Hogan <bphogan@gmail.com> wrote:> John: > I''m the author of that article. Would you please elaborate more on your > problem? Are you using the reverse_proxy_fix plugin? > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > > answer to my problem... > > a,?address (:host) > Address to bind to when listening for connections. > * Default: 0.0.0.0 (every interface) > > thanks for the documentation/site zed. > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 > > pc, by folowing the ''Serving Multiple Rails Applications on Windows > > with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) > > > > the question I have is why is why is http://localhost/myapp/ addded to > > the front of all my links and how can I stop it? > > > > origanal link using webrick /employees/edit/1214 > > now it''s > > http://localhost/myapp//employees/edit/1214 > > > > > > John Ivanoff > > > _______________________________________________ > 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 > > >
Brian Hogan
2006-Jul-07 20:26 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
I''m not sure you''re using the reverse_proxy_fix plugin correctly. The plugin only works properly in PRODUCTION mode Make sure you configure the config.rb file to point to the correct outbound address you need. http://server/controller/myapp/ Then mongrel_rails service::install -N intranet -c c:\web\intranet -p 4001-e production -a 192.168.10.246 The plugin will fix your URLs for you. To make it just http://server/controller you will need to modify the proxy settings in Apache (remove the alias folder and use document root). Then change the path in the config.rb for reverse_proxy_fix to point to http://server/controller Don''t touch routes! On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote:> > I am using the reverse_proxy_fix plugin. > > my web server is a 2k box we''ll call ''webserver''. > when I accessed http://webserver/myapp/controller locally > the page shows up, but the links point to > http://localhost/myapp//controller/action/id (this is from the source > from the displayed page) > my stylesheet was pionting to > http://localhost/myapp//stylesheets/scaffold.css?1147879980 > > which will work as long as i''m on webserver. > If I went to another pc, say ''winxp'' and I went to > ''http://webserver/myapp/controller'' the page displays, but the links > don''t ''work'' because it is trying to access localhost. follow? > > so I stoped and removed the mongrel sevice then I reinstalled using this. > mongrel_rails service::install -N intranet -c c:\web\intranet -p 4001 > -e development -a 192.168.10.246 > (it''s an internal server) > and started the service. it''s running. > Now I go to http://webserver/myapp/controller all the links go to > /controller/action/id (from web page source). > so now the links don''t work because the app name (myapp) is not in the url > path. > do I need to do something with route? > I would actually like hide the application from the URL. > so instead of http://server/myapp/controller > it would be http://server/controller > > I''m not sure If I confused you or made it more clear > > thanks. > john > > On 7/7/06, Brian Hogan <bphogan@gmail.com> wrote: > > John: > > I''m the author of that article. Would you please elaborate more on your > > problem? Are you using the reverse_proxy_fix plugin? > > > > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > > > > answer to my problem... > > > > a,?address (:host) > > Address to bind to when listening for connections. > > * Default: 0.0.0.0 (every interface) > > > > thanks for the documentation/site zed. > > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > > I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 > > > pc, by folowing the ''Serving Multiple Rails Applications on Windows > > > with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) > > > > > > the question I have is why is why is http://localhost/myapp/ addded to > > > the front of all my links and how can I stop it? > > > > > > origanal link using webrick /employees/edit/1214 > > > now it''s > > > http://localhost/myapp//employees/edit/1214 > > > > > > > > > John Ivanoff > > > > > _______________________________________________ > > 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 > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060707/03059e82/attachment.html
Zed Shaw
2006-Jul-08 01:34 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
On Fri, 2006-07-07 at 14:29 -0500, John Ivanoff wrote:> answer to my problem... > > a,?address (:host) > Address to bind to when listening for connections. > * Default: 0.0.0.0 (every interface) > > thanks for the documentation/site zed.Another approach is to set the X-Fowarded-For header in the web server in front. Weird thing is Apache is supposed to do this already when it proxies a connection. Mongrel will pick-up this header and set REMOTE_HOST to it so that rails gets the routing and rewrites correct. Run your app with one mongrel and the -B option turned on for a couple requests. Then go look at the log/mongrel_debug/rails.log file and see what headers it''s giving to your rails app. If REMOTE_HOST says localhost then something''s not right with your apache config. If you don''t see X_FORWARDED_FOR as well then research via google how to set it with mod_header and force it to the vhost. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
John Ivanoff
2006-Jul-10 16:48 UTC
[Rails] Re: mongrel/win32/apache2 link modification question.
Brian, Got it to work, I didn''t notice i was in development mode. thanks for you help. john On 7/7/06, Brian Hogan <bphogan@gmail.com> wrote:> I''m not sure you''re using the reverse_proxy_fix plugin correctly. The plugin > only works properly in PRODUCTION mode > > Make sure you configure the config.rb file to point to the correct outbound > address you need. > > http://server/controller/myapp/ > > > Then > > mongrel_rails service::install -N intranet -c c:\web\intranet -p 4001-e > production -a 192.168.10.246 > > The plugin will fix your URLs for you. > > To make it just http://server/controller you will need to modify the proxy > settings in Apache (remove the alias folder and use document root). Then > change the path in the config.rb for reverse_proxy_fix to point to > http://server/controller > > Don''t touch routes! > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > I am using the reverse_proxy_fix plugin. > > > > my web server is a 2k box we''ll call ''webserver''. > > when I accessed http://webserver/myapp/controller locally > > the page shows up, but the links point to > > http://localhost/myapp//controller/action/id (this is > from the source > > from the displayed page) > > my stylesheet was pionting to > > > http://localhost/myapp//stylesheets/scaffold.css?1147879980 > > > > which will work as long as i''m on webserver. > > If I went to another pc, say ''winxp'' and I went to > > ''http://webserver/myapp/controller '' the page displays, > but the links > > don''t ''work'' because it is trying to access localhost. follow? > > > > so I stoped and removed the mongrel sevice then I reinstalled using this. > > mongrel_rails service::install -N intranet -c c:\web\intranet -p 4001 > > -e development -a 192.168.10.246 > > (it''s an internal server) > > and started the service. it''s running. > > Now I go to http://webserver/myapp/controller all the > links go to > > /controller/action/id (from web page source). > > so now the links don''t work because the app name (myapp) is not in the url > path. > > do I need to do something with route? > > I would actually like hide the application from the URL. > > so instead of http://server/myapp/controller > > it would be http://server/controller > > > > I''m not sure If I confused you or made it more clear > > > > thanks. > > john > > > > On 7/7/06, Brian Hogan <bphogan@gmail.com> wrote: > > > John: > > > I''m the author of that article. Would you please elaborate more on your > > > problem? Are you using the reverse_proxy_fix plugin? > > > > > > > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > > > > > > answer to my problem... > > > > > > a,?address (:host) > > > Address to bind to when listening for connections. > > > * Default: 0.0.0.0 (every interface) > > > > > > thanks for the documentation/site zed. > > > > > > On 7/7/06, John Ivanoff <john.ivanoff@gmail.com> wrote: > > > > I have apache2 - mongrel 0.3.13.3-mswin32 running, on a server 2000 > > > > pc, by folowing the ''Serving Multiple Rails Applications on Windows > > > > with Apache and Mongrel'' ( http://tinyurl.com/z9ftz ) > > > > > > > > the question I have is why is why is http://localhost/myapp/ addded to > > > > the front of all my links and how can I stop it? > > > > > > > > origanal link using webrick /employees/edit/1214 > > > > now it''s > > > > http://localhost/myapp//employees/edit/1214 > > > > > > > > > > > > John Ivanoff > > > > > > > _______________________________________________ > > > 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 > > > > > > > > > > > _______________________________________________ > > 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 > > >