Virtual Host Template + Ruby on Rails LSAPI

#1
Ok, I'm trying to follow the Ruby on Rails Step-by-Step guide at: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:ruby_rails&s=ruby rails

but with a Virtual Host Template instead of a Virtual Host. I seem to be stuck on one configuration parameter though....

In trying to configure the 'Command:' parameter as '$VH_ROOT/railsapp/public/dispatch.lsapi', I keep getting the error....

*file $VH_ROOT/railsapp/public/dispatch.lsapi does not exist. Please create manually.

Only when I specify an absolute path to one of my virtual hosts' 'dispatch.lsapi', is the configuration saved. But that's not an option, because this is a virtual host template, and I need to involve $VH_ROOT in there somewhere.

Is it possible to assign a RailsLSAPI handler to a virtual host template? I want to use this as I am setting up a shared hosting environment, and don't want to hand-configure every virtual host that is created.

Thanks in advance,

-Anthony
 
#3
file is there

I checked the file, and it seems to be accessible.

Each directory has permissions 755, including the file...

But since this is a Virtual host template, and I'm using '$VH_ROOT', how does the web console know which virtual host member to check? (Granted there is only one)
 
#4
tried changing the config file....

I manually changed the 'path' node in the config file as such:

<extProcessorList>
<extProcessor>
<type>lsapi</type>
<name>$VH_NAME-RailsLSAPI</name>
<address>uds://tmp/lshttpd/rubyrailslsapi.sock</address>
<note></note>
<maxConns>10</maxConns>
<env>RAILS_ENV=production</env>
<env>LSAPI_CHILDREN=10</env>
<initTimeout>5</initTimeout>
<retryTimeout>5</retryTimeout>
<persistConn>1</persistConn>
<pcKeepAliveTimeout>10</pcKeepAliveTimeout>
<respBuffer>0</respBuffer>
<autoStart>1</autoStart>
<path>$VH_ROOT/public/dispatch.lsapi</path>
<backlog></backlog>
<instances>1</instances>
<runOnStartUp>1</runOnStartUp>
<extMaxIdleTime>10</extMaxIdleTime>
<priority></priority>
<memSoftLimit></memSoftLimit>
<memHardLimit></memHardLimit>
<procSoftLimit></procSoftLimit>
<procHardLimit></procHardLimit>
</extProcessor>
</extProcessorList>

... but I'm not sure it's working correctly. When I restarted the web server, and accessed the virtual host web site again, it came up, and there were no errors in the log... But then I changed the path to something definitely not there, and the same thing happened.

I looked at the web console status page with all of the live listeners, etc... and I think the virtual host configuration that cpanel created in my httpd.conf file is fielding the requests instead of my virtual host template.....

I see two problems with that...

1) I'm not sure the virtual host that is created from the httpd.conf file is the most efficient ruby/rails processor.

2) I wanted lsws to discard the virtual host root and document root from the httpd.conf configuration, and use my virtual host template configuration...


How do the virtual hosts from the httpd.conf file interact with the virtual hosts from the lsws config files?

I removed the mapping of my domain to my virtual host template, and the web site did then go down. So now I'm not sure which virtual host is fielding what request!! Argh!!

...confused...

-Anthony
 

mistwang

LiteSpeed Staff
#5
Vhosts defined in LSWS console should have higher priority.
You can turn on debug logging, it should show which file/directory is accessed.
 
Top