Well, maybe fastcgi is working now (I get only informative stuff in the
apache log and the fastcgi.crash.log) but I’m getting a weird
recognition error in my production log;
ActionController::RoutingError (Recognition failed for
“/images/FA_G2_08_L.jpg”):
There are 16 images in all and there’s a stack trace corresponding to
each. But there’s more
ActionController::RoutingError (Recognition failed for
“/javascripts/change_image.js”):
with stack trace and…
ActionController::RoutingError (Recognition failed for
“/stylesheets/display.css”):
etc.
So it looks like the subdirs from app_name/public are not getting found
by the default routing rules. Is there something I’m missing here? The
production database is working fine and indeed the app makes proper
queries and gets proper results if the image above is being requested. I
just thought of a possible reason for this. In my thrashing around for
the past few days I installed Rails v1.0.1. I built my app under
0.14.something. Surely, surely, that has nothing to do with it!!
James Duncan Davidson wrote:
When trying to debug a fastcgi problem under Apache 2, start up Apache
and pay very close attention to both it’s error log and the FastCGI
error log. Also, make sure that your RewriteRules are in place
correctly. If you are putting them into the main Apache configuration
file (as opposed to an .htaccess file), make sure that they are placed
inside of a Directory block. If you have it in an .htaccess file, make
sure that your server is reading and using it. Check your AllowOverrides
directives and such. If you have all the software components correct,
the big issue is probably in configuration. If you post yours, it might
be helpful for others to take a look at.
I’m running Rails V1.0.0 with Ruby 1.8.3 and Apache v2.0.39 on Mac OS X
v10.3.9
Here are relevant sections of my config;
httpd.conf;
…
LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp/fcgi_ipc
FastCgiServer /usr/local/apache2/htdocs/mj/public/dispatch.fcgi \
-initial-env RAILS_ENV=production \
-processes 15 -idle-timeout 60
...
and my virtual host setup;
<VirtualHost *:80>
ServerName mj
DocumentRoot /usr/local/apache2/htdocs/mj/public/
ErrorLog /usr/local/apache2/htdocs/mj/log/apache.log
<Directory /usr/local/apache2/htdocs/mj/public/>
Options ExecCGI FollowSymLinks
AddHandler fastcgi-script fcg fcgi fpl
AllowOverride all
Order allow,deny
Allow from all
My .htaccess file from public/ has the following top three lines from
the default produced by running, in this case, ‘rails mj’.
General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
I then uncommented the RewriteRule for fastcgi…
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
Have you considered Lighty? I only ask as I’ve got that sample
configuration already prepared and up.
It might yet come to that but I have to figure the Recognition error out
first.
–Ross