SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RoR Problem: 500 Error

    When I setup RoR on my VPS, I get the intro screen; however, where it says "About your applicationís environment", when I click it to drop down the info, I get a 500 Internal Server Error. This also occurs when I try to access parts of the application. Any Ideas?

    Thanks!

  2. #2
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its gonna be pretty hard to debug without seeing your logs.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll post them in a sec here.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The logs didn't give an error (http access logs):

    Myip - - [04/Aug/2006:17:10:02 -0400] "GET / HTTP/1.0" 200 7552 "-" "-"
    Myip - - [04/Aug/2006:17:10:03 -0400] "GET /javascripts/prototype.js HTTP/1.0" 200 55149 "-" "-"
    Myip - - [04/Aug/2006:17:10:03 -0400] "GET /javascripts/effects.js HTTP/1.0" 200 32871 "-" "-"
    Myip - - [04/Aug/2006:17:10:03 -0400] "GET /images/rails.png HTTP/1.0" 200 1787 "-" "-"
    Myip - - [04/Aug/2006:17:10:04 -0400] "GET /favicon.ico HTTP/1.0" 200 0 "-" "-"

    Nothing in the error logs for lighttpd or any of the other logs on the RoR installation logs (app/log). Are there other logs that I should be checking?

  5. #5
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does the app run fine locally? What is your setup?

  6. #6
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Luke Redpath
    Does the app run fine locally? What is your setup?
    Well, here's the site: http://www.tradergroups.com/.

    Setup:
    Latest RoR
    Lighttpd
    FastCGI
    Apache 2
    MySQL

    I have the app itself stored in /usr/tradergroups (ran rails in /usr/), with a symbolic link to the /var/www/ directory (webroot). I created a User model and Login Controller, which just bring "500 - Internal Server Error" pages when I try to navigate to them. Also, the :3000 install gives the same error (tied to ruby.tradergroups.com).

    I think the problem might be with Apache or Lighttpd...

  7. #7
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My money is on a CHMOD issue. A bit of a check list:

    /log/ (And it's contents.) - 666
    /public/ - 755
    /public/dispatch.fcgi - 755
    /tmp/ (And it's contents.) - 666

  8. #8
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried changing those just now, and I'm getting the same error. Maybe that's why the log files were empty though - so I'll keep an eye on those and post them here soon...

    Edit: Here's the lighttpd error log:
    2006-08-08 15:01:52: (mod_fastcgi.c.1470) connect failed: 8 Connection refused 111 0 /tmp/lighttpd-fcgi.socket-0
    2006-08-08 15:01:53: (mod_fastcgi.c.1925) unexpected end-of-file (perhaps the fastcgi process died): pid: 10180 fcgi-fd: 8 remote-fd: 6
    2006-08-08 15:01:53: (mod_fastcgi.c.2776) child exited, pid: 10180 status: 0
    2006-08-08 15:01:53: (mod_fastcgi.c.2823) response not sent, request sent: 1036 connection-fd: 6 fcgi-fd: 8
    2006-08-08 15:11:42: (mod_fastcgi.c.1470) connect failed: 8 Connection refused 111 0 /tmp/lighttpd-fcgi.socket-0
    2006-08-08 15:11:44: (mod_fastcgi.c.1925) unexpected end-of-file (perhaps the fastcgi process died): pid: 9287 fcgi-fd: 8 remote-fd: 6
    2006-08-08 15:11:44: (mod_fastcgi.c.2776) child exited, pid: 9287 status: 0
    2006-08-08 15:11:44: (mod_fastcgi.c.2823) response not sent, request sent: 990 connection-fd: 6 fcgi-fd: 8

    Any ideas?

  9. #9
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, my money is now on a LightTPD configuration issue. Post it if you'd like, but in my opinion you're much better off with Mongrel.

  10. #10
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need lighttpd for scalability (proxy setup), but I'll look into using Mongrel with it... thanks!

    Anyway, here's my lighttpd config file:

    # Start using ./script/server lighttpd

    server.bind = "0.0.0.0"
    server.port = 3000

    server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi", "mod_compress", "mod_expire" )

    server.error-handler-404 = "/usr/tradergroups/dispatch.fcgi"

    server.document-root = "/usr/tradergroups/public/"

    server.errorlog = "/usr/tradergroups/log/lighttpd.error.log"
    accesslog.filename = "/usr/tradergroups/log/lighttpd.access.log"

    url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )

    compress.filetype = ( "text/plain", "text/html", "text/css", "text/javascript" )
    compress.cache-dir = "/usr/tradergroups/tmp/cache"

    expire.url = ( "/usr/tradergroups/favicon.ico" => "access 3 days",
    "/usr/tradergroups/images/" => "access 3 days",
    "/usr/tradergroups/stylesheets/" => "access 3 days",
    "/usr/tradergroups/javascripts/" => "access 3 days" )


    # Change *-procs to 2 if you need to use Upload Progress or other tasks that
    # *need* to execute a second request while the first is still pending.
    fastcgi.server = ( ".fcgi" => ( "localhost" => (
    "min-procs" => 1,
    "max-procs" => 1,
    "socket" => "/usr/tradergroups/tmp/sockets/fcgi.socket",
    "bin-path" => "/usr/tradergroups/public/dispatch.fcgi",
    "bin-environment" => ( "RAILS_ENV" => "development" )
    ) ) )

    mimetype.assign = (
    ".css" => "text/css",
    ".gif" => "image/gif",
    ".htm" => "text/html",
    ".html" => "text/html",
    ".jpeg" => "image/jpeg",
    ".jpg" => "image/jpeg",
    ".js" => "text/javascript",
    ".png" => "image/png",
    ".swf" => "application/x-shockwave-flash",
    ".txt" => "text/plain"
    )

    # Making sure file uploads above 64k always work when using IE or Safari
    # For more information, see http://trac.lighttpd.net/trac/ticket/360
    $HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
    server.max-keep-alive-requests = 0

  11. #11
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LightTPD isn't my domain, but this seems to be spot on. Hope it helps.

  12. #12
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll give it a shot!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •