Forum: Ruby on Rails Ruby on Rails under Apache/FastCGI problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F14efd8e36012e3878f6c02138e57160?d=identicon&s=25 Matthias Pronk (Guest)
on 2005-12-12 15:51
Hi!

I'm trying to get Rails work with Apache/FastCGI, but it seems to error
on something I can't trace. I have the Oracle database driver (OCI8)
installed, but I currently don't use it (the database.yml is configured
to use MySQL). For some reason, I had to add the Oracle environment
variables to get the Rails FastCGI server to boot. Everything works fine
when I use Webrick (i.e. ./script/server).

Any help is appreciated!

TIA,
- Matthias



The error I get in my Apache error_log:
--------------------------------------------------
[Mon Dec 12 15:44:18 2005] [notice] Apache/2.0.52 (CentOS) configured --
resuming normal operations
[Mon Dec 12 15:44:18 2005] [warn] FastCGI: server
"/srv/www/public/dispatch.fcgi" started (pid 16778)
[Mon Dec 12 15:44:26 2005] [error] [client 127.0.0.1] FastCGI:
incomplete headers (35 bytes) received from server
"/srv/www/public/dispatch.fcgi"
--------------------------------------------------


The related part of the Apache configuration:
--------------------------------------------------
LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
  FastCgiIpcDir /tmp/fcgi_ipc
  FastCgiServer /srv/www/public/dispatch.fcgi \
    -initial-env RAILS_ENV=development \
    -initial-env LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib \
    -initial-env ORACLE_HOME=/usr/lib/oracle/10.2.0.1/client \
    -processes 2 \
    -idle-timeout 60
</IfModule>

<Directory /srv/www/public>
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]

ErrorDocument 500 /500.html
ErrorDocument 404 /404.html
</Directory>
--------------------------------------------------
A7db9ec803b5895ae5f916a74e2db329?d=identicon&s=25 Hunter's Lists (Guest)
on 2005-12-12 18:24
(Received via mailing list)
I was fighting this problem for a few days. I don't really know what
solved
it but I did the following:

Reinstalled the FCGI gem.
Rebuilt .htaccess, dispatch.fcgi and dispatch.rb

It's working now but who knows.
F14efd8e36012e3878f6c02138e57160?d=identicon&s=25 Matthias Pronk (Guest)
on 2005-12-12 22:14
That didn't fix the problem. I think I'll use lighttpd instead (that
works fine now).

Thanks anyway!

- Matthias


Hunter's Lists wrote:
> I was fighting this problem for a few days. I don't really know what
> solved
> it but I did the following:
>
> Reinstalled the FCGI gem.
> Rebuilt .htaccess, dispatch.fcgi and dispatch.rb
>
> It's working now but who knows.
This topic is locked and can not be replied to.