Setup for Rails via Litespeed Ruby LSAPI

#1
While there is fairly good documentation of the process for running Rails on Litespeed via FastCGI, I'm having trouble finding a step-by-step description of the configuration process for deploying Rails apps via the Litespeed Ruby LSAPI.

Steps done so far:
Code:
$ cd ruby-lsapi-1.0
$ ruby setup.rb config
$ ruby setup.rb setup
$ sudo ruby setup.rb install

- Copy dispatch.lsapi to Rails app's public/ directory
- Change shebang line to reference /opt/local/bin/ruby
- Change rewrite rule in public/.htaccess as described in Ruby LSAPI README
- Add same rewrite rule in Litespeed admin console (just in case)
- Server Configuration > External Apps > Add, Type: LSAPI APP
I tried to configure the many LSAPI app options, but aside from adding an extra environment variable LSAPI_CHILDREN=n to match the "Max Conns" value, it's not clear to me what the other option values should be set to. When I restart Litespeed and test the Rails app in the browser, a dialog appears to download dispatch.lsapi as a binary file.

I'm sure I'm missing something relatively simple, but with no documentation of the process to go by, I'm flummoxed. As mentioned above, a detailed, step-by-step walkthrough for creating a new Rails virtual host in Litespeed and getting it working via the Ruby LSAPI would be most greatly appreciated. I'm happy to volunteer myself as the lab rat! ;)

With sincere gratitude,

Justin
 

mistwang

LiteSpeed Staff
#2
Sorry for lacking a step by step tutorial, we will add one later.

I think the step you missing is to configure a mount point of the LSAPI dispatcher. You can do that by either

To add a LSAPI context with URI: /dispatch.lsapi, using the LSAPI as handler.

Or

To add a script handler for suffix "lsapi", using the LSAPI as handler.

I personally prefer the first approach. The Rails app should be ready to roll. :)
 
Top