# Apache 2.0 \<=\> Pen \<=\> Mongrel problems

**URL:** <https://www.ruby-forum.com/t/apache-2-0-pen-mongrel-problems/88057>\
**Category:** Deployment\
**Created:** [March 7, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/apache-2-0-pen-mongrel-problems/88057 "2007-03-07T20:45:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tilthouse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@tilthouse](https://www.ruby-forum.com/u/tilthouse)\
**Post date:** [March 7, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/apache-2-0-pen-mongrel-problems/88057/1 "2007-03-07T20:45:48Z")

</div>

I have a Centos server that I would rather not upgrade to Apache 2.2  
due to other sites in production (and the PITA that the upgrade  
appears to be). So, I’m using Apache 2.0 \<=\> Pen \<=\> 3 Mongrels

3 Mongrels on 11100-11102.  
Pen on 11180.

(Aside: Pen vs. Pound? Opinions? Tradeoffs?)

> From the command line on the server, I can see that that is working.  
> “lynx http://  
> localhost:11180/events” gives me back a “Routing Error: no route  
> found  
> to match “/events” with {:method=\>:get}”. That’s correct – there is  
> no such route. The important thing is that it’s talking to a mongrel.

It’s the Apache \<=\> Pen that I can’t get to work.

Below is my entry in conf.d: (a few items replaced with [stuff] in  
brackets to protect the innocent…

Any obvious issues? I can get to the static web page, but not the  
rails app…

\<VirtualHost [IP\_Address]:80\>

# RoR app

#SetEnv RAILS\_ENV development  
SetEnv RAILS\_ENV production

ServerName [fqdn of virtual host]  
ServerAlias [hostname of virtual host]  
DocumentRoot /home/boster/www/tilthouse/dev/rails/[app\_dir]/temp-  
deploy/public

LogFormat “%h %l %u %t "%r" %\>s %b "%{Referer}i" "%  
{User-Agent}i"”  
CustomLog /home/boster/www/logs/[hostname].access\_log common  
ErrorLog /home/boster/www/logs/[hostname].error\_log

\<Directory “/home/boster/www/tilthouse/dev/rails/[app\_dir]/temp-  
deploy/public”\>  
Options FollowSymLinks  
AllowOverride None  
Order allow,deny  
Allow from all

ProxyRequests Off

\<Proxy \*\>  
Order deny,allow  
Allow from all

ProxyPass / [http://localhost:11180/](http://localhost:11180/)  
ProxyPassReverse / [http://localhost:11180/](http://localhost:11180/)

RewriteEngine On

# Rewrite index to check for static

# Letting rails handle the case with routes

RewriteRule ^/$ /index.html [QSA]

# Rewrite to check for Rails cached page

RewriteRule ^([^.]+)$ $1.html [QSA]

# Expanded setup to only proxy rails pieces (not static pages)

# Adapted from [http://rubyforge.org/pipermail/mongrel-users/2006-](http://rubyforge.org/pipermail/mongrel-users/2006-)

July/000757.html  
RewriteCond $1 !images|errors|stylesheets|javascripts|files|  
favicon.ico|robots.txt

# Redirect all non-static requests to cluster

# XXX DON’T check the filesystem, as this is extremely slow for

each

# XXX request. Instead, rely on the patterns above. Add more if

needed.  
#RewriteCond %{DOCUMENT\_ROOT}/%{REQUEST\_FILENAME} !-f

# Pass everything else thru to mongrel cluster

#RewriteRule ^/(.\*)$ balancer://mongrel\_cluster%{REQUEST\_URI}  
[P,QSA,L]

---

<div class="post-metadata">

**Author:** ![tilthouse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@tilthouse](https://www.ruby-forum.com/u/tilthouse)\
**Post date:** [March 7, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/apache-2-0-pen-mongrel-problems/88057/2 "2007-03-07T21:59:58Z")

</div>

On Mar 7, 2:44 pm, “tilthouse” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a Centos server that I would rather not upgrade to Apache 2.2  
> due to other sites in production (and the PITA that the upgrade  
> appears to be). So, I’m using Apache 2.0 \<=\> Pen \<=\> 3 Mongrels
> 
> 3 Mongrels on 11100-11102.  
> Pen on 11180.
> 
> (Aside: Pen vs. Pound? Opinions? Tradeoffs?)

Sorry to answer indirectly, but I’ve used this exact configuration  
with Balance before.

It was very simple, and very easy.

> **[Balance :: Balance by Inlab Networks](https://balance.inlab.net)**
>
> Balance is our well known open source load balancing solution being a simple but powerful generic tcp proxy with round robin load balancing and failover capabilities. Its behaviour can be easily controlled at runtime using a simple command line...

–  
– Tom M.  
– CTO, Engine Y.
