[Mongrel] what should be correct .conf file for being served by apache for static content

Brett Walker lapomme00 at gmail.com
Thu Sep 7 08:37:22 EDT 2006


Hemant,

I went through this same issue a couple of days ago.  I had it
configured just like you do, and thought Apache was serving the static
files.  Took me half a day to figure out the problem.

My problem ended up being the permissions on the base directory.  Was
serving my app from a subdir in my home directory, and it didn't have
the correct permission for the apache process to read it.  I did a

chmod 755 /home/myuser

and suddenly Apache could server the static files.

Also, if you stop Mongrel, then try to serve one of your static files,
you can tell for sure whether Apache is serving it or not.

Cheers,
Brett

On 9/7/06, hemant <gethemant at gmail.com> wrote:
> Recently while i turned on USR1 debugging...mongrel running behind Apache2.2
> threw following debugging messages:
>
> Thu Sep 07 15:58:30 IST 2006: 0 threads sync_waiting for /charts/%5EBSESN, 1
> still active in mongrel.
>  Thu Sep 07 15:58:40 IST 2006: 0 threads sync_waiting for
> /images/tab_but_normal1.png, 3 still active in mongrel.
> Thu Sep 07 15:58:40 IST 2006: 0 threads sync_waiting for /images/msgBg1.gif,
> 3 still active in mongrel.
>  Thu Sep 07 15:58:40 IST 2006: 0 threads sync_waiting for
> /images/flash/video/BloomBerg.jpg, 1 still active in
> mongrel.
>
>
> Now..Zed earlier...pointed that, why the hell..your mongrel is serving
> static content.Well , thankfully earlier logs were from mongrel running
> standalone in development mode.
> But how about the above? why I am still getting these logs? Are my static
> pages served by mongrel:
>
>
> > <VirtualHost *:80>
> >     ServerAdmin webmaster at dummy-host.example.com
> >     DocumentRoot /var/www/ubac_webfront/public
> >     ServerName foobar.com
> >     ServerAlias *.foobar.com
> >   <Directory /var/www/ubac_webfront/public>
> >     Options FollowSymLinks
> >     AllowOverride None
> >     Order allow,deny
> >     Allow from all
> >   </Directory>
> >   RewriteEngine On
> >
> >   # Make sure people go to www.myapp.com, not myapp.com
> >   RewriteCond %{HTTP_HOST} ^foobar.com$ [NC]
> >   RewriteRule ^(.*)$ http://www.foobar.com$1 [R=301,L]
> >   # Yes, I've read no-www.com, but my site already has much Google-Fu on
> >   # www.blah.com. Feel free to comment this out.
> >
> >   # Uncomment for rewrite debugging
> >   #RewriteLog logs/myapp_rewrite_log
> >   #RewriteLogLevel 9
> >
> >   # Check for maintenance file and redirect all requests
> >   RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
> >   RewriteCond %{SCRIPT_FILENAME} !maintenance.html
> >   RewriteRule ^.*$ /system/maintenance.html [L]
> >
> >   # Rewrite index to check for static
> >   RewriteRule ^/$ /index.html [QSA]
> >
> >   # Rewrite to check for Rails cached page
> >   RewriteRule ^([^.]+)$ $1.html [QSA]
> >
> >   # Redirect all non-static requests to cluster
> >   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
> >   RewriteRule ^/(.*)$
> balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
> >
> >   # Deflate
> >   AddOutputFilterByType DEFLATE text/html text/plain text/xml
> application/xml application/xhtml+xml text/javascript text/css
> >   BrowserMatch ^Mozilla/4 gzip-only-text/html
> >   BrowserMatch ^Mozilla/4.0[678] no-gzip
> >   BrowserMatch bMSIE !no-gzip !gzip-only-text/html
> >   # Uncomment for deflate debugging
> >   #DeflateFilterNote Input input_info
> >   #DeflateFilterNote Output output_info
> >   #DeflateFilterNote Ratio ratio_info
> >   #LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)'
> deflate
> >   #CustomLog logs/myapp_deflate_log deflate
> > </VirtualHost>
>
>  It is just a copy and paste of coda and philip's configurations.
>
> --
> nothing much to talk
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
>


More information about the Mongrel-users mailing list