I have one machine and two ruby applications, app1 and app2.
Currently, I have an Apache server and a mongrel server. Apache runs
on port 80 and proxies to mongrel on port 3001, which runs app1. But
I wish to run both applications on the one machine. There is
documentation that suggests clustering. But each application will
need it's own URL, http://localhost/app1 and http://localhost/app2.
Can anyone direct me on how to do this?
John - you're gonna want to look into virtual hosts.
Virtual hosts allow you to serve multiple sites from one IP address.
Here's a sample server_one.com vhost. Sending server_one.com requests to a cluster of 4 mongrels- Duplicate it, and change for a second to answer on the same ip. Not the below may need some more params to work plus the correct mods installed.
If you choose this approach you are, as far as I can gather, forced to
change all your hrefs & forms in the applications to mimic this sort
of set up.
I.e application: test, controller: teams, action: list
URL: http://localhost/test/teams/list
But it is quite a job to rename all the URLs in the application.
If you choose this approach you are, as far as I can gather, forced to
change all your hrefs & forms in the applications to mimic this sort
of set up.
I.e application: test, controller: teams, action: list
URL: http://localhost/test/teams/list
But it is quite a job to rename all the URLs in the application.
Is there another way around this?
Setting the routes as I did should automatically prepend test/ to
urls generated from url_for (or the things that use it (form_tag/for,
link_to etc...); at least it did when I tried it.