Windows, Apache2, FastCGI:

Arien Malec
Fri, 18 Mar 2005 16:08:42 -0000

I''ve been struggling through getting Rails to work with Apache2 &
FastCGI. I used the RubyForApache distribution of mod_fastcgi, the
latest stable Apache2, Windows XP. On the advice of a recent thread
here, my httpd.conf fastcgi section looks like so:

LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule>
	AddHandler fastcgi-script .fcgi
	FastCGIConfig -idle-timeout 600 -maxClassProcesses 5
</IfModule>

(More config file entries at the end of this message).

[Fri Mar 18 07:55:48 2005] [error] [client 192.168.2.4] FastCGI:
incomplete headers (0 bytes) received from server
"C:/amalec/ruby/rails/message/public/dispatch.fcgi"

Oddly, looking at development.log, the controller saw the request, and
claimed to have sent a response, so something is happening between
Rails, FastCGI and Apache2 on the response.

Everything works fine locally on the box, and works semi-OK (some
actions work, some don''t) on my work network, but doesn''t work
at all
in the home network.

Any advice greatly appreciated!

Thanks,
Arien

================My httpd.conf virtual directory section looks thus:

<VirtualHost *>
	ServerName msg
	DocumentRoot C:/amalec/ruby/rails/message/public
	ErrorLog C:/amalec/ruby/rails/message/log/apache.log

	<Directory C:/amalec/ruby/rails/message/public/>
		Options ExecCGI FollowSymLinks
      		AddHandler fcgi-script .fcgi
		AllowOverride all
		Allow from all
		Order allow,deny
	</Directory>
</VirtualHost>

& my .htaccess is

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# Redirect all requests not available on the filesystem to Rails
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]

# In case Rails experiences terminal errors
ErrorDocument 500 /500.html