Differences

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

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:other-ext-apps:ruby-on-rails-easy-config [2015/07/28 20:52]
Michael Alegre created
litespeed_wiki:other-ext-apps:ruby-on-rails-easy-config [2019/09/19 18:32] (current)
Jackson Zhang
Line 1: Line 1:
-====== Ruby On Rails Easy Configuration with LiteSpeed Web Server ​2.2+ ====== +====== Ruby On Rails Easy Configuration with LiteSpeed Web Server ​Native ​======
  
 +LSWS supports ruby on rails since version 2.2. The following is to setup ruby on rails with LSWS native mode. For shared hosting control panel environment with CloudLinux, please refer to [[litespeed_wiki:​cloudlinux:​enable_ruby_python_selector|this wiki]] to enable CloudLinux Ruby and Pathon selector.
 ===== Introduction ===== ===== Introduction =====
  
 LiteSpeed web server is one of the best and easiest platform for large scale Ruby On Rails application deployment. There are five options to setup Rails application with LiteSpeed server: LiteSpeed web server is one of the best and easiest platform for large scale Ruby On Rails application deployment. There are five options to setup Rails application with LiteSpeed server:
  
-  * Ruby LiteSpeed API ([[http://​www.litespeedtech.com/​lsapi/|Ruby LSAPI]])+  * Ruby LiteSpeed API ([[https://​www.litespeedtech.com/​products/litespeed-sapi/​ruby|Ruby LSAPI]])
   * LiteSpeed RubyRunner (Run CGI in persistent interpreter like mod_perl to perl)   * LiteSpeed RubyRunner (Run CGI in persistent interpreter like mod_perl to perl)
   * FastCGI   * FastCGI
Line 12: Line 12:
   * CGI   * CGI
  
-In order to maximize the performance of a Rails application,​ LiteSpeed Technologies developed our own Ruby interface module using our LiteSpeed API protocol, also known as [[http://​www.litespeedtech.com/​lsapi/​|LSAPI]]. LSAPI is a highly optimized IPC protocol between LiteSpeed web server and a standalone process which yields the best possible performance. ​+In order to maximize the performance of a Rails application,​ LiteSpeed Technologies developed our own Ruby interface module using our LiteSpeed API protocol, also known as [[https://​www.litespeedtech.com/​lsapi/​|LSAPI]]. LSAPI is a highly optimized IPC protocol between LiteSpeed web server and a standalone process which yields the best possible performance. ​
  
 LiteSpeed RubyRunner is an add-on to Ruby LiteSpeed API which allows running plain Ruby CGI in a persistent interpreter without the cost of starting a new ruby process for each CGI script. ​ However, RubyRunner is not as fast as plain LSAPI script because Ruby interpreter has to do extra work to shield the run-time environment for each CGI script execution. RubyRunner is for running plain ruby CGI script unchanged. For Rails application,​ Ruby LSAPI is preferred. ​ LiteSpeed RubyRunner is an add-on to Ruby LiteSpeed API which allows running plain Ruby CGI in a persistent interpreter without the cost of starting a new ruby process for each CGI script. ​ However, RubyRunner is not as fast as plain LSAPI script because Ruby interpreter has to do extra work to shield the run-time environment for each CGI script execution. RubyRunner is for running plain ruby CGI script unchanged. For Rails application,​ Ruby LSAPI is preferred. ​
Line 23: Line 23:
 Before you can setup RubyOnRails with LiteSpeed Web Server you should have finished the following steps: Before you can setup RubyOnRails with LiteSpeed Web Server you should have finished the following steps:
   - LiteSpeed Web Server version 2.2 or higher. If you have LSWS <2.2, please visit the [[litespeed_wiki:​other-ext-apps:​ruby-rails-old|old Ruby on Rails wiki]].   - LiteSpeed Web Server version 2.2 or higher. If you have LSWS <2.2, please visit the [[litespeed_wiki:​other-ext-apps:​ruby-rails-old|old Ruby on Rails wiki]].
-  - Latest [[http://​www.litespeedtech.com/​lsapi/|Ruby LSAPI]] for LiteSpeed. ​+  - Latest [[https://​www.litespeedtech.com/​products/litespeed-sapi/​ruby|Ruby LSAPI]] for LiteSpeed. ​
   - Have a working Ruby application installation,​ like [[http://​mentalized.net/​journal/​2006/​02/​06/​hello_ruby_on_rails_world/​|this]] simple Hello World application.   - Have a working Ruby application installation,​ like [[http://​mentalized.net/​journal/​2006/​02/​06/​hello_ruby_on_rails_world/​|this]] simple Hello World application.
  
Line 37: Line 37:
 Or, you can install from source code. Or, you can install from source code.
  
-1) Download Ruby LSAPI from [[http://​www.litespeedtech.com/​lsapi/]].+1) Download Ruby LSAPI from [[https://​www.litespeedtech.com/​index.php/​products/​litespeed-sapi/download|here]].
  
 2) Unpack. ​ 2) Unpack. ​
Line 90: Line 90:
    ​.../​lsapi.so:​ warning: already initialized constant ENV    ​.../​lsapi.so:​ warning: already initialized constant ENV
 It is normal, and means that your rails application is powered by LSAPI. :-) It is normal, and means that your rails application is powered by LSAPI. :-)
-Since Ruby-LSAPI 2.0, no more this message.+Since Ruby-LSAPI 2.0, this message ​has been gone.
  
 5) (Optional but recommended) add rewrite rules. The following rules must be added to the RubyVhost'​s "​Rewrite"​ tab, to fully enable caching. Using the standard Rails directive ''​caches_page :​action''​ will leave .html files in your public directory, but the rules below are nessesary for LiteSpeed to pick those up. 5) (Optional but recommended) add rewrite rules. The following rules must be added to the RubyVhost'​s "​Rewrite"​ tab, to fully enable caching. Using the standard Rails directive ''​caches_page :​action''​ will leave .html files in your public directory, but the rules below are nessesary for LiteSpeed to pick those up.
  • Admin
  • Last modified: 2015/07/28 20:52
  • by Michael Alegre