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 useos.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
How to Get Rspec-2 to Give the Full Trace Associated with a Test Failure
How to Use Unicorn as "Rails S"
How to See the Dependency Tree Just from Gemfile
Modify Ruby Hash in Place( Rails Strong Params)
Is There a Less Intrusive Alternative to Rspec's 'Should_Receive'
How to Convert a String to a Class Method
Are the Date, Time, and Datetime Classes Necessary
(Ruby,Rails) Context of Self in Modules and Libraries...
How to Find If a String Starts with Another String in Ruby
How to Get Elapsed Time in Milliseconds in Ruby
Rails 4 How to Ignore Pending Migrations
Should One Use Dashes or Underscores When Naming a Gem with More Than One Word
Visit_Psych_Nodes_Alias: Unknown Alias: Default (Psych::Badalias)
How to Change "Devise: Password Reset Instruction Email's Subject"
Ruby: Compare 2 Arrays for Matches, and Count the Number of Match Instances
Ruby Bundler Multiple Sources in Gemfile
Convert Non-Breaking Spaces to Spaces in Ruby
Rails - Multiple Top Level Domains and a Single Session/Cookie