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 I.

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.

John:
I’m the author of that article. Would you please elaborate more on your
problem? Are you using the reverse_proxy_fix plugin?

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

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 Fri, 2006-07-07 at 14:29 -0500, John I. 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://mongrel.rubyforge.org/
http://www.railsmachine.com/ – Need Mongrel support?

Brian,
Got it to work, I didn’t notice i was in development mode.
thanks for you help.

john

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs