503 Service Unavailable - Can't access my Rails app

Discussion in 'Ruby/Rails' started by Granny Smith, Oct 17, 2006.

  1. Granny Smith

    Granny Smith Active Member

    503 Service Unavailable (solved) - but now 404

    I didn't find anything about this problem (which probably isn't really a problem), so I post this here.

    My LiteSpeed Web Server is running and I installed the Ruby API successfully.
    I added a Virtual Host and configured it as a Rails app.
    Using domain.com, I am able to see the Ruby on Rails "Welcome aboard" page, but I can't visit the controller's page using the domain.com/controller.
    I'm a Rails noob, so I just know, that it normally works like this using WEBrick on OS X 10.4.
    What am I doing wrong? Or what do I have to change?
    Last edited: Oct 23, 2006
  2. xing

    xing LiteSpeed Staff

    Pleaes check the log directory under ruby app folder and also log entries under litespeed for the source of the error.

    More likely than not, your ruby app is not starting up correctly.
  3. Granny Smith

    Granny Smith Active Member

    lsws.log, production.log and server.log from the app's log folder are empty.

    LiteSpeed says
    But I don't have any idea what I have to do with this ...
  4. mistwang

    mistwang LiteSpeed Staff

    Is there anything logged in stderr.log?
    You can try raise "Process soft/hard limit" under "Rails" and "security" tab, see if it help.
  5. Granny Smith

    Granny Smith Active Member

    Where is this file located?

    Raising the Process soft/hard limit didn't help.
  6. mistwang

    mistwang LiteSpeed Staff

    lsws/logs/stderr.log. If you see "warning: already initialized constant ENV" then the ruby lsapi has been working properly. if you see "fork() failed", you still need to raise the "Process soft/hard limit" to maybe "100".
  7. Granny Smith

    Granny Smith Active Member

    I forgot where my lsws folder is located. :(

    But Process soft/hard limit is already 100.
  8. mistwang

    mistwang LiteSpeed Staff

    /opt/lsws? You need to figure it out! ;)
  9. Granny Smith

    Granny Smith Active Member

    I installed Ruby using Yast (on Suse 9.3) and it only "finds" version 1.8.1.
    Before I did this (installing using Yast) I already downloaded it and tried to compile and install it, but there was a problem with zlib and so somebody told my I should try it with Yast.

    But how can I get Ruby 1.8.2 or newer? Is this possible using Yast? (I'm a linux noob!)
    Or is there another way how I can update Ruby and avoid problems with zlib?
  10. mistwang

    mistwang LiteSpeed Staff

    You can install zlib from source code, then install ruby 1.8.4 or 1.8.5 from source code.
  11. Granny Smith

    Granny Smith Active Member

    From which source code? And how?
    (Sorry for this stupid noob question ...)

    Because I thought it might be a problem to run two Ruby installations I uninstalled Ruby using Yast.
    Then I installed Ruby 1.8.5 manually.

    According to Yast, zlib is installed, but installing the gems I got this via ssh
    Is there any possibility to install Rails (requiring Ruby 1.8.2 or higher) on Suse 9.3???
    Can I change the server which Yast uses to search for packages?
    Or what should I do?

    I dont have any idea and my Rails app should have been working for two weeks. :(
  12. dreamscape

    dreamscape Active Member

  13. Granny Smith

    Granny Smith Active Member

    Thanks, but this was not really my problem.

    According to Yast, zlib was already installed, but I compiled and installed it "by hand". Then I installed Ruby again, and then the gems.
    And then Rails.

    And now - Rails seems to be installed!

    But there's another problem now: Now I retrieve a "404 Not found" when trying to access my app using mydomain.com/controller.

    Litespeed says:
    What does this mean?
    What is a(?) uid?

  14. xing

    xing LiteSpeed Staff

    uid is "User ID". Please make sure LiteSpeed has the proper permission to access the rails app folder.
  15. Granny Smith

    Granny Smith Active Member

    Permissions for this folder and all subfolders are 777.
  16. xing

    xing LiteSpeed Staff

  17. Granny Smith

    Granny Smith Active Member

    This does not work. :(

    I have let this field empty and have restarted the server, but nothing changed.

    BTW: I forgot
    But I think this refers to the same problem.
  18. xing

    xing LiteSpeed Staff

    The permimission flag 777 is not the problem here but the user/group assigned to the folder in question.

    Looks like you are using suEXEC feature. Whey using suExec, litespeed does not allow execution of scripts as users with priviledges lower (more powerful) than the min uid and min gid in server security settings.

    This is done for security reasons. Set both of those to 0 and try again.
  19. Granny Smith

    Granny Smith Active Member

    Setting both to 0 doesn't work, too. And leaving them empty didn't solve the problem ...

    Can I solve this problem with changing the user?
    Currently, LiteSpeed is running as suggested as "nobody". Should I run it as root or might this be insecure?
    Or should I configure a new user with the "right" rights and then reinstall LiteSpeed (http://www.litespeedtech.com/docs/webserver/config/general/#runningAs)?

    Or do you have a better idea?
  20. xing

    xing LiteSpeed Staff

    I would recommend you to create a special non-priviledged user just for litespeed, such as "lsws". Do a clean install of LiteSpeed with the new user and go from there. You should not have this problem then.

Share This Page