lsapi and PLESK

eek

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

thank you for your effort!

Andrej
 

mistwang

LiteSpeed Staff
#24
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. :)
 

eek

Active Member
#25
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
 

eek

Active Member
#26
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
 

mistwang

LiteSpeed Staff
#27
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.
 

eek

Active Member
#28
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 ?
 

mistwang

LiteSpeed Staff
#29
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.
 

eek

Active Member
#30
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:

eek

Active Member
#32
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
 

eek

Active Member
#34
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
 

eek

Active Member
#36
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
 
Top