Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:ruby_rails_mongrel [2015/07/29 13:42]
Michael Alegre removed
— (current)
Line 1: Line 1:
-====== Ruby Rails with Mongrel ​ ====== 
  
-What is [[http://​mongrel.rubyforge.org/​|Mongrel]]?​ 
- 
-Mongrel is a HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI. 
- 
-===== LiteSpeed Integration ​ ===== 
-  
-Mongrel is not a SAPI interface but an full blown HTTP server designed to serve Ruby applications. As such, integration with LiteSpeed is straightforward using single "​proxy"​ server external application format or load balanced "​proxies"​. 
- 
-===== Setup for Single Mongrel Backend ===== 
- 
-1) Create a Vhost under LiteSpeed. 
- 
-2) Under the Vhost'​s "​External Apps" tab, create a new external application of type "​Proxy":​ 
- 
-<​code>​ 
-Type: Proxy 
-Name: MyMongrel1 <-- any name you want 
-Address: 127.0.0.1:​88 <-- format: ip:port this is your Mongrel port 
-</​code>​ 
- 
-3) Under the Vhost'​s "​Contexts"​ tab, create a new context of type "​Proxy":​ 
- 
-<​code>​ 
-type: Proxy 
-URI:  /  <-- the uri that will route requests to the Mongrel backend. "/"​ translate to all requests. 
-Web Server: MyMongrel1 <-- select the proxy you have setup in setup 2. 
-</​code>​ 
- 
-4) Restart and enjoy! 
- 
-===== Setup for Loadbalanced Multiple Mongrel Backend ===== 
- 
-Setup is same as single Mongrel backend except for step 3. 
- 
-3) Under the Vhost'​s "​Contexts"​ tab, create a new context of type "Load Balancer":​ 
- 
-<​code>​ 
-type: Load Balancer 
-URI:  /  <-- the uri that will route requests to the mongrel backend. "/"​ translate to all requests. 
-Workers: proxy::​MyMongrel1,​ proxy::​MyMongrel2,​ proxy::​MyMongrel3 ​ 
-</​code>​ 
- 
-The "​Workers"​ field is where you need to list all the proxies/​Mongrel backends you have created in step 2. Format for workers field: 
- 
-<​code>​ 
-proxy::​PROXY1,​ proxy::​PROXY2 ... 
-</​code> ​ 
- 
-===== Performance Note ===== 
- 
-As Mongrel is another abstraction layer, it is slower than using Ruby LSAPI with LiteSpeed and much slower when Mongrel is used to serve static content as compared to LiteSpeed. ​ 
- 
-To mitigate the fact that Mongrel is not designed to efficiently serve static content, we highly recommend all Mongrel users setup a "​Static"​ "​Context"​ with higher priority (lower number) with the LiteSpeed Vhost configuration pointing to the static image/​css/​etc files. This method allows LiteSpeed to offload all static delivery from Mongrel. 
  • Admin
  • Last modified: 2015/07/29 13:42
  • by Michael Alegre