They don??™t have to be located
on the same machine, and you can also choose to separate proxying between two different
machines. Just type in the different addresses.
The next step is to create a VirtualHost that uses this balancer. You also want to have a
balancer-manager, so you can handle the proxy balancing in real time from the web. Begin by
adding that:
SetHandler balancer-manager
With this in place, you can visit http://localhost/balancer-manager and get much valuable
information about your current load, and also change and administrate many settings.
The VirtualHost itself needs to pass these proxy requests:
ServerName shoplet
ProxyRequests off
ProxyPass /balancer-manager !
ProxyPass / balancer://shopletcluster
ProxyPassReverse / balancer://shopletcluster
Now you can start up your application, and everything should just work if you access
http://localhost/. You may use different Mongrels each time, but you don??™t notice that
CHAPTER 11 ?– DEPLOYMENT 206
because Rails doesn??™t care. You should add some security to the balancer-manager, by the way.
As is, anyone can change your proxy balancing settings, which can??™t be good.
Make WAR with Java
As mentioned in the whirlwind tour, you install GoldSpike as a plug-in in the Rails application
you want to use it from, and then use one of several Rake targets provided to package everything
into a nice WAR file.
Pages:
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313