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