From: Andrey <chocholl@gmail.com>> Subject: [Rails] apache cgi error
> To: rails@lists.rubyonrails.org
> Message-ID: <399b361e2d05a8daf16c279837d6fddc@ruby-forum.com>
> Content-Type: text/plain; charset=utf-8
>
> Good day.
> First of all sory for my english, it isnt well.
>
> I have my first ruby on rails application.
> When i use WEBrick my app works fine.
>
> But when i tried to run it under apache, i have the following
> message in
> browser:
> __________________
> Application error
> Rails application failed to start properly
> __________________
>
> The message in apache error log:
> __________________
> malformed header from script. Bad header=58: dispatch.cgi
> __________________
>
>
> And the most unintelligible fact is the message in rails development
> log. In this log i see that the app gets the request from
> apache and do
> its work, as it runs from WEBrick.
>
> My httpd.conf is
>
> <VirtualHost myservername>
> ServerName rails
> DocumentRoot /path/to/my/application/public/
> ErrorLog /var/log/httpd/rails.log
>
> <Directory /path/to/my/application/public/>
> Options ExecCGI FollowSymLinks
> AllowOverride all
> Order allow,deny
> Allow from all
> </Directory>
> </VirtualHost>
>
>
> and all necessary modules has been loaded.
This could be happening if you have an extra line break added to the
first line of dispatch.cgi. This could happen if you have uploaded the
files using windows.
Run ''cat -v public/dispatch.cgi | head -1'' and see if there is
a hidden
''^M'' at the end of the line, if so remove it and try again.
Bharat
http://blog.publishedperspectives.com