I am running ruby 1.8.4 and rails 1.0.0 with Apache 2. I made a simple
rails application called demo and also created a controller called say
and an action called hello which is working fine using webrick. To run
it under Apache I created a symlink demo1 which is linked to the
demo/public directory. If I run it using www.example.com/demo1 then I
get the “Rails- Welcome Aboard” page. However, the problem starts when I
try to access www.example.com/demo1/say/hello. It gives, “Application
error
Rails application failed to start properly” When I do a tail -f
error_log then I get “Premature end of script headers: dispatch.cgi”.
Since I spent almost a day trying to work out the problem and visiting
several forums where most of the people advise on checking the
permission of log files and shebang in dispatch.cgi which I already
checked but now I am not sure what is wrong.
I would be really grateful if you could tell me what I might be doing
wrong.
Please let me know if you want to have a look at my dispatch.cgi or any
other file.
Thanks for the reply. I tried running it from the command line
(./dispatch.cgi) and I get a “500 internal Server Error”
Any ideas why I am getting this?
That’s actually a good sign(!)
In my experience, that means everything is basically OK,
and the error is generated because there is no request
on STDIN (when you run it via the command line).
Is it really dispatch.cgi or is it dispatch.fcgi?
This may have to do with web server config, since
it appears (in a rather twisted fashion) that all
else is OK.
Thanks for the reply. I tried running it from the command line
(./dispatch.cgi) and I get a “500 internal Server Error”
Any ideas why I am getting this?
That’s actually a good sign(!)
In my experience, that means everything is basically OK,
and the error is generated because there is no request
on STDIN (when you run it via the command line).
Is it really dispatch.cgi or is it dispatch.fcgi?
This may have to do with web server config, since
it appears (in a rather twisted fashion) that all
else is OK.
–
– Tom M.
Yes, it is dispatch.cgi, so what might be wrong with the server config?
I have copied a portion of my config file below, please let me know if
you find something wrong in there.
<Directory /var/www/vhosts/******/httpdocs/demo/public/>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Allow from all
Order allow,deny
<Directory /var/www/vhosts//web_users>
AddType text/plain .php .php4 .php3 .phtml
php_admin_flag engine off
AddType text/plain .php .php5 .php4 .php3 .phtml
php_admin_flag engine off