Trying to get a test app going

Discussion in 'Ruby/Rails' started by ffeingol, Oct 15, 2008.

  1. ffeingol

    ffeingol Well-Known Member

    Hello all,

    We're trying to play with our first RoR app on a cPanel server. Sorry, the doc's are not clear so I have a bunch of questions. We're setup for RoR shared hosting enviroment:

    A) Does the .ls_rails_config go in the users home directory or under public_html?

    B) Where do you actually put the rails app, under the users home dir or public_html?

    I seem to remember (form somewhere) that you have to remove the public_html and then simlink public_html to the application.


  2. mistwang

    mistwang LiteSpeed Staff

    .ls_rails_config should to in the users home directory.

    You can put the application anywhere under user's home directory. so, if you want to put it under public_html, just use configuration like
    RailsApp myApp1 "/public_html/myapp1" "development" 4 1
    RailsAppMap myApp1 "" "/"
    Even when you do not put the application under public_html, there is no need to create symbolic link, litespeed will add a "Alias" from "myapp1/public/" to the URL specified.
  3. ffeingol

    ffeingol Well-Known Member

    ok, we got that working (just some wrong paths in the .ls_rails_cnfig). Now the site owner is saying this:

    "main "/" isnt spawning the ruby process and displaying a blank page rather then calling the default route".

    Any help on that one?
  4. mistwang

    mistwang LiteSpeed Staff

    If that server is not too busy, you can try turning on LSWS debug logging. make sure that "Ruby path" pointing to correct ruby installation.
  5. burmjohn

    burmjohn New Member

    Just to clarify, we got it working last night.

    The only thing that wasn't working was the - but that seems to be an .htaccess issue. ( I posted what I added below to get it working)

    Can you confirm what the .htaccess should be in the rails app's public directory?

    RewriteEngine On
    RewriteRule ^$ index.html [QSA]
    Also it seems some processes seem to be lightening fast, then the next time I hit refresh it takes up to 20 seconds to render. (same page)

    - John
  6. mistwang

    mistwang LiteSpeed Staff

    yes, put .htaccess file under public directory.

    Some time is slow because the ruby process has terminated, so the rails framework will be reinitialized from scratch. It is slow. You can tune it with environment variables
  7. burmjohn

    burmjohn New Member

    Is the .htaccess I posted above sufficient / correct for LS?

    - John
  8. mistwang

    mistwang LiteSpeed Staff

    Yes, that's correct.

Share This Page