[Rails] 0.10 + Apache + fcgi

Belorion belorion at gmail.com
Tue Mar 1 14:44:49 GMT 2005


Thank you for the reply.  I worked with a user over IRC last night
(quesera) to get things up and running.  It turns out my main problem
has to do with the fact that my .htaccess file is not being read. 
I've had to add the contents of the .htaccess file to my vhosts
directive in my httpd.conf.

Even though things are running now, it feels ... messy.  Does anyone
know why my .htaccess file is being ignored? The relevant part of my
httpd conf (before I add the contents of my .htaccess file) is:

<VirtualHost *:80>
  ServerName suvaservers.game-host.org
  DocumentRoot /var/www/applications/servers/public/

  <Directory "/var/www/applciations/servers/public/">
    AllowOverride All
  </Directory>
 
(then, later)
FastCgiServer /var/www/applications/myapp/public/dispatch.fcgi
-initial-env RAILS_ENV=production

And my .htaccess (in /var/www/applications/myapp/public/) file looks like:

# 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


</VirtualHost>

And yes, my .htaccess file is 644.


More information about the Rails mailing list