Letting Apache server public/sitemaps/* files?

Subscribe to Letting Apache server public/sitemaps/* files? 5 post(s), 2 voice(s)

 
Avatar Jörg B. 6 post(s)

Hello there,

quick Q: I am generating a / multiple sitemap.xml(.gz) via a rake task and place them in the public/sitemaps/ folder of my rails app. However, when trying to access these files, mongrel/rails seems to handle them instead of apache serving the static files… how and where would I change the appropriate config to let apache take care of these files?

Cheers and thanks,
-J

 
Avatar Jörg B. 6 post(s)

:)

Anyone?

 
Avatar Jörg B. 6 post(s)

To answer my own question, I took my rails-apps config under /etc/apache2/sites-available/ and added this block right above the Proxy balancer: delcaration:

# Configure mongrel_cluster

ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass /sitemaps !
ProxyPass /javascript !
ProxyPass / balancer://mongrel_cluster/
ProxyPassReverse / balancer://mongrel_cluster
ProxyPreserveHost On

… Which works now.

 
Avatar David Smalley Administator 36 post(s)

I think that the setup of the Apache config is supposed to only proxy things which do not exist as physical files.

If you look in /etc/apache2/brightbox-common you will see:

# Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]

Odd that it seems to be sending your sitemap request through to the balancers anyway though.

Glad you have a solution now.

 
Avatar Jörg B. 6 post(s)

David,

yep I did see that rule but for some reason my default fallback route (rails app) kicked in and was run/displayed.

All’s good now, thanks! :)

-J

Signup or login to contribute