![]() |
LSAPI and Shared Hosting not working
The wiki regarding RoR in a shared environment is pretty short:
http://www.litespeedtech.com/support...:rails_hosting It says to enable the 'Rails shared hosting', it doesn't even go into detail about installing Rails or the LSAPI, one presumes that comes from the other two guides. However, having done the install, enabled the shared hosting for rails, the error_log show: Code:
2012-11-19 15:36:51.291 [INFO] [127.0.0.1:51156-0#APVH_exmaple.com:lsapi] connection to [/tmp/lshttpd/APVH_example.com:testApp.sock] on request #0, confirmed, 0, associated process: -1, running: 0, error: Connection reset by peer!Code:
2012-11-19 15:36:51.622 [STDERR] /usr/local/lsws/fcgi-bin/RailsRunner.rb:131:in `require': cannot load such file -- config/environment (LoadError)This file does exist, and actually if you strace the lsws process it shows the file being accessed at the RoR application location within the user account. Code:
926369 open("config/environment.rb", O_RDONLY <unfinished ...> |
change that line to
Quote:
|
Thanks, that worked, but now there's another error:
Code:
#Code:
require 'initializer' |
Looks like there is no enough information for litespeed to detect the version of Rails being used, and it defaults to Rails 2.3 branch of code.
If the Rails app involved is >2.3 release, you should set "RAILS_GEM_VERSION" variable in "config/environment.rb" explicitly for that application. |
Thanks, again another error:
Code:
2012-11-22 09:08:33.770 [STDERR] /usr/local/lsws/fcgi-bin/RailsRunner.rb:29:in `require') |
Those errors are due to Ruby/Gem/Rails update. It was working well in production for many years.
For the "require lsapi" error, you need to locate the gem folder, like /usr/lib64/ruby/gems/1.9.1/gems/ruby-lsapi-4.0/ Just follow the instruction in README to manually install it into ruby system folder, it can be always located by ruby. |
Thanks. That has resolved the error, however there is a further error now:
Code:
/usr/local/lsws/fcgi-bin/RailsRunner.rb:91:in `<main>': uninitialized constant RAILS_ROOT (NameError) |
Yes, there is a updated version of RailsRunner.rb, please manually upgrade to 4.2.1 release with command
/usr/local/lsws/admin/misc/lsup.sh -f -v 4.2.1 |
That seems to have done the trick, thanks. I think I might be seeing this problem:
http://www.litespeedtech.com/support...87&postcount=8 In so much when running as development and the moment you try to add a route and remove the public/index.html it doesn't actually recognise the changes and actually doesn't even pass the request to the rails handler. In fact, the HTTP header returns: Code:
X-Powered-By: PHP/5.4.8Adding any non-existant route such as /foo/bar to the request results in a proper Rails-handled request. It's just when requesting the root of the app that nothing happens. |
Seems you have directory autoindexing enabled. turn off directory index should fix this.
|
| All times are GMT -7. The time now is 12:55 AM. |