Specifications
Chapter 5 Working with Open Source Applications 73
9 Select the Enable Reverse Proxy checkbox.
10 Verify that the Proxy path eld is set to “/.”
This requires URLs within the website to be proxied to the balancer group.
11 Leave the Stick Session Identier eld blank unless you have reason to specify a value.
12 To add a balancer member, click the Add (+) button below the Balancer Members list.
13 From the Server URL pop-up menu, designate the URL for the load balancer member.
Each instance of Mongrel running locally has its URL shown in the pop-up menu, so
you should be able to select one.
Create additional balancer members if you have multiple instances of Mongrel serving
your web application on this host or other reachable hosts. Each balancer member
corresponds to an instance of Mongrel, running on the local host or other hosts.
14 If there is only one balancer member, set the Load Factor to 100.
Use the Load Factor eld to distribute the load among balancer members.
15 Leave the Route eld blank unless you have a specic reason to enter a value.
16 Click OK.
17 Click Save.
18 Start Web service, if it is not running.
19 Use Safari to access the proxy URL to conrm that the web application is responding:
http://127.0.0.1
If you specied a model or scaold in your Rails application, the URL might be
something like http://127.0.0.1/<ModelName>.
It is not necessary to enter a trailing slash.
Scenario 2 — Sharing a Website (Virtual Host) with the Proxied Web Application
1 Open Terminal and enter the following commands to create your Ruby on Rails
application outside the document root of an existing web virtual host (for example in /
Library/WebServer/MyWebApp, where MyWebApp is the name of your rails application).
$ cd /Library/WebServer
$ rails MyWebApp
$ ...
2 Start the Mongrel web server using the mongrel_rails_persist command and using
the --prefix argument:
$ sudo mongrel_rails_persist start -p 3001 --prefix /rails -c /Library
/WebServer/MyWebApp
3 Use Safari to access the local Rails URL to conrm that the web application is responding:
http://127.0.0.1:3001/rails/