# Production Env Issue: Ubuntu Mongrel Apache proxy Capistrano

**URL:** <https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170>\
**Category:** Deployment\
**Created:** [May 14, 2007, 11:12pm UTC](https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170 "2007-05-14T23:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![navneetaron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/838e76/32.png) [@navneetaron](https://www.ruby-forum.com/u/navneetaron)\
**Post date:** [May 14, 2007, 11:12pm UTC](https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170/1 "2007-05-14T23:12:08Z")

</div>

Hi Everyone,  
Context:

I am building a ruby on rails app. After I successfully built and tested  
it in development environment, I used Capistrano to deploy it to a  
different machine with pretty much same configuration. The server is a  
Ubuntu linux box running Apache 2 and mongrel cluster. The application  
is deployed using Capistrano.

Issue:  
Even if I shut down mongrel cluster, and I open the root url of my site  
in a browser (e.g [www.mywebsite.com](http://www.mywebsite.com)), apache still serves up content . I  
don’t know where it is getting it from. It seems like a cached version.  
I’m expecting it to give me an error saying that Mongrel is down (or  
something like that)

Similarly, when mongrel cluster is running, and I open the root url in  
browser, still the STALE content is served rather than newer content  
(which I know should be displayed).  
I want www mywebsite com to use routing to get data from  
www mywebsite com/mycontroller/myaction

If I open the complete url (including controller and action), then  
correct content is served up. Note that this problem happens only in  
Production environment.

Earlier I thought this was a routing error. But I’ve made sure that  
correct routing is in place. Any pointers/help is really appreciated.

Thanks  
Navneet

---

<div class="post-metadata">

**Author:** ![navneetaron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/838e76/32.png) [@navneetaron](https://www.ruby-forum.com/u/navneetaron)\
**Post date:** [May 15, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170/2 "2007-05-15T19:03:07Z")

</div>

Are you using page caching? If so, ensure that cached files (by  
default stored in public/ as controller/action.html or index.html)  
should be deleted.

Vish

---

<div class="post-metadata">

**Author:** ![navneetaron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/838e76/32.png) [@navneetaron](https://www.ruby-forum.com/u/navneetaron)\
**Post date:** [May 15, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170/3 "2007-05-15T20:32:09Z")

</div>

Thanks Vishnu. index.html was there (I believe it was generated as a  
page cache). I deleted it . But can you help me understand why does it  
get created? So should I disable page caching. It might have an effect  
on the performance… Thoughts??

Thanks  
Navneet

Vishnu G. wrote:

> Are you using page caching? If so, ensure that cached files (by  
> default stored in public/ as controller/action.html or index.html)  
> should be deleted.
> 
> Vish

---

<div class="post-metadata">

**Author:** ![navneetaron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/838e76/32.png) [@navneetaron](https://www.ruby-forum.com/u/navneetaron)\
**Post date:** [May 16, 2007, 11:30am UTC](https://www.ruby-forum.com/t/production-env-issue-ubuntu-mongrel-apache-proxy-capistrano/104170/4 "2007-05-16T11:30:44Z")

</div>

You should enable page caching, but have proper sweepers so that the  
cache is deleted. Also, when your mongrels are down (which should  
happen only on new code rollout), ensure that your webserver rewrite  
rules searches for maintenance.html (assuming ur using capistrano),  
and if that exists, only display that. Proper configs are all over the  
net for Apache, nginx, and with a few hacks, lighttpd. Also, on  
mongrel-cluster start/stop, you should delete your page cache.  
Searching for a “page cache” tutorial on Google would help.

Vish
