LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > lsapi with camping?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2007, 10:56 AM
kuzb kuzb is offline
New Member
 
Join Date: Jun 2007
Posts: 1
Default lsapi with camping?

Has anyone configured the camping microframework with lsapi? I'm trying to figure out how to do it, but the lsapi docs are nearly non-existant.

Any help appreciated :)
Reply With Quote
  #2  
Old 06-13-2007, 12:38 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Please consult the README file and a few examples in our ruby-lsapi.
Ruby CGI/FCGI can be easily converted to use our LSAPI interface.
Reply With Quote
  #3  
Old 07-14-2007, 05:32 AM
plato plato is offline
New Member
 
Join Date: Jul 2007
Posts: 6
Hi,

I'm in the same situation, trying to run a camping application on the litespeed server. I read the README and modified the application according to the lsapi recommendations. But I'm still not able to access the application. If I access the root url the server sends a 404 error message. But I can access all files which are part of the application, e.g. /application.rb .

So how do I need to configure litespeed? I think thats my problem.

Bye
Reply With Quote
  #4  
Old 07-14-2007, 07:52 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
please checkout scripts/lsruby_runner.rb, creat a LSAPI external app, add a "script handler" to let it handle ".rb" files.
All the ".rb" file will be run inside the persistent Ruby Runner process as CGI script.
Reply With Quote
  #5  
Old 07-14-2007, 11:56 AM
plato plato is offline
New Member
 
Join Date: Jul 2007
Posts: 6
I've added a LSAPI external application with the address "UDS://path/to/ruby-lsapi-2.5/scripts/lsruby_runner.rb" and added the ext app as a script handler with suffixes "rb".

But now I receive a 503 error message and I can't find any log information about that. Did I use the wrong parameter values for the ext app and script handler?

Thanks
Reply With Quote
  #6  
Old 07-14-2007, 12:14 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You configuration is wrong. Plase use our lsphp external app as a reference.
/path/to/ruby-lsapi-2.5/scripts/lsruby_runner.rb should be the command to be exeuted, not the socket path.

Please check error.log and stderr.log for error messages related.
Reply With Quote
  #7  
Old 07-14-2007, 12:50 PM
plato plato is offline
New Member
 
Join Date: Jul 2007
Posts: 6
The following error is thrown:

from /usr/local/lib/ruby/gems/1.8/gems/ruby-lsapi-2.5/scripts/lsruby_runner.rb:3
/usr/local/lib/ruby/gems/1.8/gems/ruby-lsapi-2.5/scripts/lsruby_runner.rb:3:in `require': no such file to load -- lsapi (LoadError)

Is that a known bug or just a specific one on my side? I uninstalled and reinstalled the ruby-lsapi gem, but that didn't solve the problem. And I never installed ruby-lsapi manually before.

Thanks
Reply With Quote
  #8  
Old 07-14-2007, 12:56 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
The gem install only works with Rails I guess, unless you explicitly include gem packages. You need to install ruby-lsapi manually.
Reply With Quote
  #9  
Old 07-14-2007, 01:35 PM
plato plato is offline
New Member
 
Join Date: Jul 2007
Posts: 6
I installed ruby-lsapi manually and modify my application.rb a bit, and now I get 500 error messages. The server says "Premature end of response header.". There are no other error messages.

Is this a server configuration problem or something related to my application?

Thanks
Reply With Quote
  #10  
Old 07-14-2007, 02:01 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You should not modify your application.rb to use LSAPI directly if you use the ruby runner. ruby runner is the LSAPI application, which can only run plain CGI written in ruby.
If you convert your application.rb to LSAPI, then get rid of the ruby runner. And define a LSAPI context and use it as the handler.

Either way should work, just do not mix them together. Plase go through our documentation.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:33 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.