Litespeed + Ruby/RoR + cPanel, problems installing Redmine

Discussion in 'General' started by tracktor1, Jun 5, 2012.

  1. tracktor1

    tracktor1 Member

    Problem installing RoR app in Litespeed (no such file to load -- lsapi)

    Hi guys!

    I am having some problems installing Redmine (as an example of RoR app) in Litespeed (cPanel 11.32/CloudLinux)

    We are installing Redmine from a test cPanel account (logged as a normal user for redmine installation steps), the goal is document the process and make a tutorial to teach our clients about how to use Litespeed + Ruby / RoR.

    Its a shared hosting server with cPanel, to complete the installation of Redmine 1.4 I used several resources:

    Finally we achieve the installation of Redmine but does not run properly, get this error:

    503 Service Unavailable 
    Checking the logs I see:

    2012-06-05 18:22:09.558 [STDERR] /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require': no such file to load -- lsapi (MissingSourceFile)
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
    	from /usr/local/lsws/fcgi-bin/RailsRunner.rb:29

    We have installed ruby-lsapi, restarted the app, restarted LiteSpeed and nothing... always have the same error.

    Other info:
    # gem list --local | grep lsapi
    ruby-lsapi (4.0)
    # ruby -v
    ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
    # gem -v
    # rails -v
    Rails 2.3.14
    Litespeed 4.1.12
    cPanel 11.32
    I would appreciate any help

    Last edited: Jun 6, 2012
  2. mistwang

    mistwang LiteSpeed Staff

    I think you need to update cagefs to include ruby lsapi. it only installed at server level, but not included in cagefs for each user account.
  3. tracktor1

    tracktor1 Member

    Hi mistwang,

    First, thanks for the reply.

    The problem is I do not use cagefs (disabled).

    I found other user with (apparently) the same problem:

    But this no work for me, ruby-lsapi is installed.

    # gem install ruby-lsapi
    Building native extensions.  This could take a while...
    Successfully installed ruby-lsapi-4.0
    1 gem installed
    Installing ri documentation for ruby-lsapi-4.0...
    Installing RDoc documentation for ruby-lsapi-4.0...
    # service lsws restart
    # touch /home/user_cpanel/.ls_rails_config
    We're a little desperate ... any ideas would be appreciated.

  4. tracktor1

    tracktor1 Member

    Problem solved! I reinstalled ruby-lsapi manually and now work fine... but I have other problem.

    Redmine appear to work fine if I access for example to:

    But when I try access to:

    I see the public directory content (listing)

    I tried with this rules but dont work:

    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.lsapi [QSA,L]
    Please some help! with this

  5. mistwang

    mistwang LiteSpeed Staff

    is .htaccess enabled?
    Do you have "RewriteEngine on" in the .htaccess?
  6. tracktor1

    tracktor1 Member

    >is .htaccess enabled?

    Yes, is enabled.

    >Do you have "RewriteEngine on" in the .htaccess?


    In this moment the .htaccess appear to work (I think this was a browser cache problem) but the main problem continues :(

    The problem now is the same comented in the last reply but I see a strange behavior:

    When the rules are added in the .htaccess, redmine stop working, all petitions redirect to "dispatch.lsapi" but instead run, it displays the contents of this file (permissions 755 in this file):

    if GC.respond_to?(:copy_on_write_friendly=)
        GC.copy_on_write_friendly = true
    require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
    # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
    # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
    require "dispatcher"
    require "lsapi"
    while LSAPI.accept != nil
    When I remove the .htaccess, Redmine work fine without using rules or dispatch.lsapi (strange?) but the first problem appear again, access to index dont work, appear the directory listing.
  7. mistwang

    mistwang LiteSpeed Staff

    You can just turn off directory indexing from .htaccess, it should be direct to rails automatically.
    right now, no need to create dispatch.lsapi file.
  8. tracktor1

    tracktor1 Member

    no luck...

    I put "Options -Indexes" (now this file only contains this directive) in .htaccess (inside public folder of redmine) and is showing the tipical 403 Forbidden error.

    Internal pages like /login, /projects, etc work perfect but the start page continue without work...

  9. marcelruhf

    marcelruhf New Member

    Rewrite rule

    Maybe try this in your .htaccess:

    RailsBaseURI /

Share This Page