Hello. I am trying to get a rails app to run with lsapi as described in the litespeed wiki:
http://litespeedtech.com/community/wiki/doku.php?id=litespeed_wiki:ruby_rails
When I try to run the app, I continually get a 503 Service Unavailable error.
Below I have listed everything I did in the install, and my configuration, as well as the errors from the log. I tried to follow the instructions precisely, but I cannot make it work. Can anyone help?
Thanks, Shelby
_________________________________________________
I am running Litespeed 2.1.18 std on Linux. It serves static pages fine.
I installed mysql, created the database, and set database.yaml in the rails app with the correct user name and password. I can use rake migrate successfully to create the tables, so I know that the database connection works.
I have installed ruby and rails. I have installed litespeed ruby lsapi via
gem install ruby-lsapi. I copied the dispatch.lsapi into my rails public directory and made it executable. All the files in the rails app are readable by the server. In order to try and keep it simple, I am setting it up to run only one rails app for this virtual host.
I created a virtual host just for this web app. its config:
virtual host root: /absolute/path/to/railsapp/ (note - directory above public)
config file: /absolute/path/to/railsapp/config.xml
enable script: yes
restrained: no
GENERAL TAB
document root: /absolute/path/to/railsapp/public/
enable gzip: yes
customized error pages: 404 not found -- /dispatch.lsapi
EXTERNAL APPS
I created a lsapi app...
name: RubyRailsLSAPI
address: uds://tmp/lshttpd/rubyrailslsapi.sock
max connections: 10
environment:RAILS_ENV=production
LSAPI_CHILDREN=10
initial request timeout: 5
retry timeout: 5
persistent connection: yes
response buffering: no
command: /absolute/path/to/railsapp/public/dispatch.lsapi
CONTEXT
I created a LiteSpeedAPI context
URI: /dispatch.lsapi
LSAPI App: [VHostLevel] RubyRailsLSAPI
other than these settings, I left everything else blank.
I saved everything and restarted the server. I try to access the railsapp like this:
http://test.virtualhostname.org/login/login
and receive a 503 service unavailable error
Here is what my log shows:
2006-08-05 23:59:57.674 INFO [192.168.0.101:57801-0#mta_pmta] File not found [/absolute/path/to/railsapp/public/login/login]
2006-08-05 23:59:57.675 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
2006-08-05 23:59:57.676 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
2006-08-05 23:59:57.676 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
It seems to be looking for an actual file at the URL, rather than executing the rails application at that controller and method.
Note that this webapp does run fine on my development machine under webrick with the url:
http://127.0.0.1/login/login
http://litespeedtech.com/community/wiki/doku.php?id=litespeed_wiki:ruby_rails
When I try to run the app, I continually get a 503 Service Unavailable error.
Below I have listed everything I did in the install, and my configuration, as well as the errors from the log. I tried to follow the instructions precisely, but I cannot make it work. Can anyone help?
Thanks, Shelby
_________________________________________________
I am running Litespeed 2.1.18 std on Linux. It serves static pages fine.
I installed mysql, created the database, and set database.yaml in the rails app with the correct user name and password. I can use rake migrate successfully to create the tables, so I know that the database connection works.
I have installed ruby and rails. I have installed litespeed ruby lsapi via
gem install ruby-lsapi. I copied the dispatch.lsapi into my rails public directory and made it executable. All the files in the rails app are readable by the server. In order to try and keep it simple, I am setting it up to run only one rails app for this virtual host.
I created a virtual host just for this web app. its config:
virtual host root: /absolute/path/to/railsapp/ (note - directory above public)
config file: /absolute/path/to/railsapp/config.xml
enable script: yes
restrained: no
GENERAL TAB
document root: /absolute/path/to/railsapp/public/
enable gzip: yes
customized error pages: 404 not found -- /dispatch.lsapi
EXTERNAL APPS
I created a lsapi app...
name: RubyRailsLSAPI
address: uds://tmp/lshttpd/rubyrailslsapi.sock
max connections: 10
environment:RAILS_ENV=production
LSAPI_CHILDREN=10
initial request timeout: 5
retry timeout: 5
persistent connection: yes
response buffering: no
command: /absolute/path/to/railsapp/public/dispatch.lsapi
CONTEXT
I created a LiteSpeedAPI context
URI: /dispatch.lsapi
LSAPI App: [VHostLevel] RubyRailsLSAPI
other than these settings, I left everything else blank.
I saved everything and restarted the server. I try to access the railsapp like this:
http://test.virtualhostname.org/login/login
and receive a 503 service unavailable error
Here is what my log shows:
2006-08-05 23:59:57.674 INFO [192.168.0.101:57801-0#mta_pmta] File not found [/absolute/path/to/railsapp/public/login/login]
2006-08-05 23:59:57.675 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
2006-08-05 23:59:57.676 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
2006-08-05 23:59:57.676 INFO [uds://tmp/lshttpd/rubyrailslsapi.sock] Connection refused, restart!
It seems to be looking for an actual file at the URL, rather than executing the rails application at that controller and method.
Note that this webapp does run fine on my development machine under webrick with the url:
http://127.0.0.1/login/login