httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Hodges <>
Subject [users@httpd] RE: Rails via mongrel, always getting 404
Date Sat, 13 Nov 2010 16:13:14 GMT
I found the problem

The fix I used is here

all is well

From: Brad Hodges []
Sent: Saturday, November 13, 2010 6:18 AM
To: ''
Subject: [users@httpd] Rails via mongrel, always getting 404

I can't get my Rails app served up on Apache2.2 running on Windows via mongrel.

At some level it is working,  I can get my Rails app to receive requests from mongrel,  and
the Rails app appears to be happy,  but Apache always returns 404 not found.

I'm using mod_proxy like so:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot E:/DEV/pdftk/public/
      XSendFile On
      XSendFilePath E:/DEV/pdftk/public/
<Directory "E:/DEV/pdftk/public/" >
          Options -Indexes FollowSymLinks MultiViews
          AllowOverride None
          Order Deny,Allow
          Allow from any
      RewriteEngine On
      RewriteRule ^/$ /index.html [QSA]
      RewriteRule ^([^.]+)$ $1.html [QSA]
      RewriteRule "^/(images|stylesheets|javascripts)/?(.*)" "$0" [L]
      RewriteCond %{DOCUMENT_ROOT)/%{REQUEST_FILENAME} !-f
      RewriteRule ^/(.*)$ balancer://pdftk_cluster%{REQUEST_URI} [P,QSA,L]
      <Proxy balancer://pdftk_cluster>
            BalancerMember http://pdftk:3005
            BalancerMember http://pdftk:3006
      ProxyPass / balancer://pdftk_cluster
      ProxyPassReverse / balancer://pdftk_cluster
      ProxyPreserveHost On
      ErrorLog E:/DEV/pdftk/log/error.log
      CustomLog E:/DEV/pdftk/log/access.log combined
      LogLevel debug

There are no errors  in the Apache error log,  all I see is the load balance, the setup /
tear down of the mongrel proxy request, etc.  ,  and the Rails log is happy, it thinks it's
working normally.   The Rails app just processes some pdf building stuff,  that takes about
1600ms, and sends back the pdf.  But Apache, as soon as it hands off the proxy request to
mongrel, is returning 404 to the client,  even though the proxy request completes correctly,
1600ms later,  without error.    Why would Apache not wait for the Proxy to complete?  Why
could it be returning a 404 error immediately ?

I normally deploy Rails under passenger on Solaris,  and I've never had construct  httpd.conf
from scratch until now,  so this is likely something obvious and simple.

The rest of my httpd.conf:

(if this config seems dangerous,  this machine is not accessible via the public internet,
 I started opening up everything in an attempt to track down this 404 problem)

ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

LoadModule actions_module modules/
LoadModule alias_module modules/
LoadModule asis_module modules/
LoadModule auth_basic_module modules/
LoadModule authn_default_module modules/
LoadModule authn_file_module modules/
LoadModule authz_default_module modules/
LoadModule authz_groupfile_module modules/
LoadModule authz_host_module modules/
LoadModule authz_user_module modules/
LoadModule autoindex_module modules/
LoadModule cgi_module modules/
LoadModule dir_module modules/
LoadModule env_module modules/
LoadModule include_module modules/
LoadModule isapi_module modules/
LoadModule log_config_module modules/
LoadModule mime_module modules/
LoadModule negotiation_module modules/
LoadModule proxy_module modules/
LoadModule proxy_ajp_module modules/
LoadModule proxy_balancer_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_ftp_module modules/
LoadModule proxy_http_module modules/
#LoadModule proxy_scgi_module modules/
LoadModule rewrite_module modules/
LoadModule setenvif_module modules/
LoadModule xsendfile_module modules/

DocumentRoot E:/DEV/pdftk/public/

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
ErrorLog "logs/error.log"
LogLevel debug
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    CustomLog "logs/access.log" common

DefaultType text/plain
EnableSendfile On
EnableMMAP Off
ProxyRequests Off
Include ( what's shown above)

View raw message