[Rails] 0.10 + Apache + fcgi

Belorion belorion at gmail.com
Tue Mar 1 17:25:27 GMT 2005


I finally got it working.  And you won't beleive how.

First, I took the <Directory> out of within <VirtualHost>.  This alone
did not fix it though.
Next, I replaced:

AllowOverride All /var/www/applications/servers/public

With 

AllowOverride All /

This of course turned on overrides for *everything*, but I wanted to
see if it would work.  It did.  So then I changed it to /var, then to
/var/www, etc (with a httpd restart between eacah, of course). By the
time I got to /var/www/applications/servers/public, it was still
working.  WORKING!  UGH.  Seriously, the only thing I did between the
time it didn't work and the time it did was step through each
directory with AllowOverride All.  So strange, so very strange.


On Tue, 1 Mar 2005 08:44:49 -0600, Belorion <belorion at gmail.com> wrote:
> 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