lsapi and PLESK

Discussion in 'Ruby/Rails' started by eek, Oct 19, 2007.

  1. eek

    eek New Member

    mistwang,

    any idea ? :(
  2. mistwang

    mistwang LiteSpeed Staff

    Have you configured a subdomain for that vhost under plesk? Can you PM me the configuration for this vhost and subdomain if available?
  3. eek

    eek New Member

    yes, domain and subdomain(s) (there are more not just nlcman) are configured via plesk. config PMed

    thank you for your effort!

    Andrej
  4. mistwang

    mistwang LiteSpeed Staff

    OK, found the problem. The plesk generated virtual host configuration for domain and subdomain does not have a "User" or "SuexecUserGroup" directive, so LSWS cannot determine which user own those vhosts, thus, cannot figure out the user's home directory and load the .ls_rails_config there.

    The solution is esay, you can let plesk generate suEXEC enabled configuration which include required information. :)
  5. eek

    eek New Member

    mistwang,

    thank you very much! i'll look into this since suexec is not activated in our apache installation.

    i'll report back

    thank you very much again!

    Andrej
  6. eek

    eek New Member

    mistwang,

    ok! everything works perfectly, except one small thing. The dir in <App Path> variable in the .ls_rails_config has to have a "/" at the end otherwise it doesn't match the rails route for "index" (map.connect '', :controller => ...) and look for a regular index file.

    another thought, maybe you guys could add information from this thread to the wiki entry that deals with PLESK (or make a new entry), since there might be someone that would need it (like myself :)) and i think the wiki is the first place where they'll look (maybe it's just me that didn't know what exactly to do), anyway just a thought.

    again, thanks for all the help!

    Andrej
  7. mistwang

    mistwang LiteSpeed Staff

    Thanks for the feedback, the wiki has been update.
    I think the problem you mentioned is the mapping URL, not the "App path". we will have it addressed in 3.3 release.
  8. eek

    eek New Member

    mistwang,

    i guess you are right, since i have set up another rails domain and the AppPath has trailing "/" and the root route doesn't work .. when do you think the 3.3 will be out ? :) or do you have any suggestion how to how to patch this other than not use the root route ?
  9. mistwang

    mistwang LiteSpeed Staff

    The root route should work well as there is a "/". If you use it in the sub-domain, you need to make sure the sub-domain has "User" or "suexecusergroup" directive in that vhost configuration.
  10. eek

    eek New Member

    yes the subdomain vhost container has the suexecusergroup. and the .ls_rails_config looks like this:

    Code:
    #RailsApp <name> <App Path> <Rails Evn> <Children Processes> <RunOnStart>
    RailsApp nlcman "/subdomains/nlcman/httpdocs/current/" "development" 4 1
    RailsApp 0209 "/subdomains/0209/httpdocs/current/" "staging" 4 1
    
    RailsAppMap nlcman "nlcman.newline-projects.com" "/"
    RailsAppMap 0209 "0209.newline-projects.com" "/"
    and the root route for both off the apps is:
    Code:
    map.connect '', :controller => 'dashboard'
    but http://0209.newline-projects.com/ doesn't go to the rails app it serves the index of the default plesk vhost

    but if you go to a particular controller like 0209.newline-projects.com/pages it works just fine
    Last edited: Oct 29, 2007
  11. mistwang

    mistwang LiteSpeed Staff

    I think that page is cached, clear your browser cache.
  12. eek

    eek New Member

    wasn't the cache.

    this is in the log file
    Code:
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] New request:
            Method=[GET], URI=[/],
            QueryString=[]
            Content Length=0
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] Find context with URI: [/], location: [/var/www/vhosts/newline-projects.com/subdomains/0209/httpdocs/releases/20071029172319/public/]
    2007-10-30 04:18:14.294 [DEBUG] [HTAccess] Updating configuration file [/var/www/vhosts/newline-projects.com/subdomains/0209/httpdocs/.htaccess]
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] processContextPath() return 24
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] processNewReq() return 24.
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] HttpConnection::sendHttpError(),code=403 Forbidden
    2007-10-30 04:18:14.294 [DEBUG] [85.237.18.135:1263-0#APVH_0209.newline-projects.com:80] redirect to:
            URI=[/error/noindex.html],
            QueryString=[]
    
    it returns 403 code
  13. mistwang

    mistwang LiteSpeed Staff

    Then you need to find out why it ends up with 403? file/directory permission or something else?
  14. eek

    eek New Member

    mistwang,

    i figured the previous "problem" out, since the documentroot of the vhost wasn't the same as the root of the rails app (rails app root is in documentroot/current) the rails .htaccess file was necessary in the documentroot in order for the root route to work.

    but you gonna love this one :)

    i had 3 sites configured like this
    Code:
    RailsApp nlcman.newline-projects.com "/subdomains/nlcman/httpdocs/current" "staging" 2 1
    RailsAppMap nlcman.newline-projects.com "nlcman.newline-projects.com"  "/"
    
    RailsApp mynewline.newline-projects.com "/subdomains/mynewline/httpdocs/current" "staging" 2 1
    RailsAppMap mynewline.newline-projects.com "mynewline.newline-projects.com"  "/"
    
    RailsApp 0209.newline-projects.com "/subdomains/0209/httpdocs/current" "staging" 2 1
    RailsAppMap 0209.newline-projects.com "0209.newline-projects.com"  "/"
    and everything worked perfectly until i add another site, like this
    Code:
    RailsApp nlcman.newline-projects.com "/subdomains/nlcman/httpdocs/current" "staging" 2 1
    RailsAppMap nlcman.newline-projects.com "nlcman.newline-projects.com"  "/"
    
    RailsApp mynewline.newline-projects.com "/subdomains/mynewline/httpdocs/current" "staging" 2 1
    RailsAppMap mynewline.newline-projects.com "mynewline.newline-projects.com"  "/"
    
    RailsApp 0209.newline-projects.com "/subdomains/0209/httpdocs/current" "staging" 2 1
    RailsAppMap 0209.newline-projects.com "0209.newline-projects.com"  "/"
    
    RailsApp 0169.newline-projects.com "/subdomains/0169/httpdocs/current" "staging" 2 1
    RailsAppMap 0169.newline-projects.com "0169.newline-projects.com"  "/"
    and none of the railsrunners were running and i found this in the log:
    Code:
    2007-11-01 15:10:06.804 [INFO] Rails application 'nlcman.newline-projects.com' has been added successfully, 2 of 100 has been used.
    2007-11-01 15:10:06.804 [INFO] Rails application '0209.newline-projects.com' has been added successfully, 4 of 100 has been used.
    2007-11-01 15:10:06.804 [INFO] Rails application 'mynewline.newline-projects.com' has been added successfully, 6 of 100 has been used.
    2007-11-01 15:10:06.804 [INFO] Rails application '0169.newline-projects.com' has been added successfully, 8 of 100 has been used.
    2007-11-01 15:10:06.805 [INFO] Rails application 'nlcman.newline-projects.com' has been mounted at vhost: APVH_nlcman.newline-projects.com:80, URI: /.
    2007-11-01 15:10:06.805 [INFO] Rails application '0209.newline-projects.com' has been mounted at vhost: APVH_0169.newline-projects.com:80, URI: /.
    2007-11-01 15:10:06.805 [INFO] Rails application '0209.newline-projects.com' has been mounted at vhost: APVH_0209.newline-projects.com:80, URI: /.
    2007-11-01 15:10:06.806 [INFO] Rails application 'mynewline.newline-projects.com' has been mounted at vhost: APVH_mynewline.newline-projects.com:80, URI: /.
    the rails app 0209 was mapped to 0169.newline-projects.com ...

    so i removed the 0169 app definition and map lines stopped and started LS, but the 0209 app was still being mapped to 0169 vhosts .. any idea ? now i'm really lost

    Andrej
  15. mistwang

    mistwang LiteSpeed Staff

  16. eek

    eek New Member

    mistwang,

    i'm sorry to report that looks like it doesn't work in 3.3 either :(

    it looks like the domains and vhosts that start with numbers are causing this problems.

    Andrej
  17. mistwang

    mistwang LiteSpeed Staff

    Fixed in the latest 3.3 build. please download and give it a try.
  18. eek

    eek New Member

    mistwang,

    yes! it works :)

    thank you

    Andrej
  19. jordan

    jordan New Member

    the shared rails hosting is enabled, with no values for the two Max variables

Share This Page