malformed header from script. Bad header=HTTP/1.1 200 OK:

333 views
Skip to first unread message

ger...@gmail.com

unread,
Sep 16, 2008, 4:06:33 PM9/16/08
to Phusion Passenger Discussions
I managed to get phusion working fine on a Red Hat box, but am getting
the following error in my apache logs on Debian whenever I try to
access any action in a rails app:

malformed header from script. Bad header=HTTP/1.1 200 OK:

After poking around online I saw the most common cause of this is some
extra puts commands lying around, mucking up the headers created by
rails. However, I tested this on a fresh rails application with just
one action (and no puts commands), and still get the same error.

Here are the pertinent apache configuration settings I am using:

PassengerRoot /usr/src/passenger-2.0.3
PassengerRuby /usr/bin/ruby1.8

<VirtualHost ...>
ServerName ...
DocumentRoot /var/www/rails_app/current/public
</VirtualHost>

I'm running apache 2.2.3 with rails 2.1.1. The applications which are
causing this error all work fine under mongrel and the rails logs in
production.log aren't showing any errors. I'm assuming I missed some
step while installing or configuring phusion, but have retraced my
steps and can't find whatever it was. Does anyone know a way I can
have rails or phusion spit out the headers being created to a log so I
can see what is malformed about them? Or, better yet, has anyone else
ran into this and found a solution?

ger...@gmail.com

unread,
Sep 17, 2008, 2:12:32 PM9/17/08
to Phusion Passenger Discussions
Well, I managed to figure out the source of my woes. Here's the
solution, in case someone else runs into this problem. The error was
a result of using mod_security and the SecServerSignature
configuration setting being like so:

SecServerSignature "Microsoft IIS/5.0"

I'd been meaning to disable that for a while, so I guess i deserved
the afternoon of my head hitting the keyboard. Once I commented that
out and used the apache ServerSignature setting instead, everything
worked great.
Reply all
Reply to author
Forward
0 new messages