Passenger: Internal Server Error

Passenger: internal server error

I found the answer what is causing it in my case. In my config.ru I was redirecting STDOUT like this:

log = File.new("logs/std.log", "a+")
STDOUT.reopen(log)

Removing the redirect into the log and it starts up again.

Looks like passenger needs STDOUT to detect a working "preloader".


Edit: I'm currently using the following solution to redirect the log into a file and keep passenger happy (basically just duplicating stdout into the log file and not redirecting):

log = File.new("logs/std.log", "a+")
def STDOUT.write string
log.write string
super
end
STDOUT.sync = true

500 internal server error in ruby on rails

Read the Apache error log file. If Phusion Passenger does not display an error message in the browser, then it will print the error message to the log file.

Django: 500 internal server error with Passenger on Dreamhost

In the directory /home/user/example.com you need to add a symlink to your database file too.

Also:

  • You only need to append /home/user/example.com/project to the path. The other two are not necessary, though they should not cause problems.
  • Instead of hardcoding the path /home/user/example.com/project you can use os.getcwd():

    sys.path.append(os.path.join(os.getcwd(), 'project'))

After you make changes to this file or other files in your project, don't forget to do touch tmp/restart.txt to notify Passenger.

By the way, at the moment Django works with Python versions 2.6.5 to 2.7 with experimental support for 3.2 and 3.3. According to the Python wiki on DreamHost, most servers should be using Python 2.6.6 as of February 2012, except some servers. Check your version of Python with python --version and if it's not 2.6.6 then you can ask the support team to upgrade it on your server.

I tried using Django with Python 3.2 or 3.3 on DreamHost but it's problematic. It doesn't work with 3.2 because the mod_wsgi module of Apache does not seem to work with this version at the moment. It could work if you install it from source, but being a shared hosting, we don't have control over that. I don't know for sure but if mod_wsgi doesn't work with 3.2 then it won't work with 3.3 either. So I think it's best to stick to a supported version of 2.x version if you want to use Django on Dreamhost.



Related Topics



Leave a reply



Submit