# Using Mongrel,and Apache Alias

**URL:** <https://www.ruby-forum.com/t/using-mongrel-and-apache-alias/108207>\
**Category:** Rails\
**Created:** [June 30, 2007, 12:09am UTC](https://www.ruby-forum.com/t/using-mongrel-and-apache-alias/108207 "2007-06-30T00:09:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeZach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@JoeZach](https://www.ruby-forum.com/u/JoeZach)\
**Post date:** [June 30, 2007, 12:09am UTC](https://www.ruby-forum.com/t/using-mongrel-and-apache-alias/108207/1 "2007-06-30T00:09:31Z")

</div>

I’m trying to bring my rail app into production on a server I have,  
but I keep running into problems getting Apache and Mongrel to play  
nicely.

Short Summary:

Mongrel is up and running fine (port 8000) and I can connect to it and  
browse my app without issue. The problem is trying to proxy it  
through Apache. My current apache server is used to serve several  
other no rails applications and I have no way of changing that. I am  
trying to alias to the rails app, and let mongrel handle it in the  
background. Whenever I browse to my rails app through my apache, I  
get page not found errors, for everything. I looked in my production  
log, and apparently it is trying to send my alias director (/tora) to  
the router, instead of using it as the document root. Below is the  
error, and the apache.conf settings I am using for my alias. Any help  
would be greatly appreciated.

-----------------------ERROR----------------------------

Processing ApplicationController#index (for 160.129.18.96 at  
2007-06-29 17:07:09) [GET]  
Session ID: 35cdb51b7a9eb766702bc4ee9be34945  
Parameters: {}

ActionController::RoutingError (no route found to match “/tora/” with  
{:method=\>:get}):  
/vendor/rails/actionpack/lib/action\_controller/routing.rb:1292:in  
`recognize_path' /vendor/rails/actionpack/lib/action_controller/routing.rb:1282:in `recognize’  
/vendor/rails/railties/lib/dispatcher.rb:40:in `dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: 78:in `process’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:  
76:in `synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: 76:in `process’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in  
`process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `each’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in  
`process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in  
`initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `new’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `initialize’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in  
`new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
configurator.rb:271:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ configurator.rb:270:in `each’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
configurator.rb:270:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in `run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:  
211:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/bin/mongrel_rails:16:in `load’  
/usr/bin/mongrel\_rails:16

-----------------------.CONF----------------------------

Alias /tora “/var/www/tora/public”  
\<Directory “/var/www/tora/public”\>  
Options FollowSymlinks  
AllowOverride None  
Order allow,deny  
Allow from all

RewriteEngine On

RewriteCond %/var/www/tora/public/system/maintenance.html -f  
RewriteCond %{SCRIPT\_FILENAME} !maintenance.html  
RewriteRule ^.\*$ /system/maintenance.html [L]

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

RewriteCond %/var/www/tora/public/%{REQUEST\_FILENAME} !-f  
RewriteRule ^/(.\*)$ balancer://mongrel\_cluster%{REQUEST\_URI} [P,QSA,L]

\<Proxy balancer://mongrel\_cluster\>  
BalancerMember [http://127.0.0.1:8000](http://127.0.0.1:8000)  
BalancerMember [http://127.0.0.1:8001](http://127.0.0.1:8001)
