# Newbie question about mongrel

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-mongrel/92971>\
**Category:** Rails\
**Created:** [April 26, 2007, 5:46am UTC](https://www.ruby-forum.com/t/newbie-question-about-mongrel/92971 "2007-04-26T05:46:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 26, 2007, 5:46am UTC](https://www.ruby-forum.com/t/newbie-question-about-mongrel/92971/1 "2007-04-26T05:46:55Z")

</div>

Hi,

I am very new to ruby, rails, and mongrel, so this may not make any  
sense, but i figured i would ask it anyways.

I have been given the task of determining if rails is a good  
transition for our company.

While my preliminary tests have been successful (i.e. installing  
mongrel, deploying a test app, etc), i have to figure out how to run  
our existing cgi scripts under our new environment.

Previously we were using apache + mod\_perl, and my question is do i  
still need to install mod\_perl, or is mongrel optimized to handle perl  
in a fast fashion?

secondly, how do i run a cgi script when running rails, do i simply  
put a cgi-bin directory in my public directory under my rails app, or  
is it more complicated than that (i.e. modifying my httpd.conf file to  
point somewhere other than rails/mongrel)?

sorry for my lack of understanding of apache+rails+mongrel, but I am  
learning as i go.

thanks!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mongrel/92971/2 "2007-04-27T18:59:40Z")

</div>

Hi Faisal,

so I took your advice, I decided to use mod\_perl and mongrel together,  
and I installed mod perl, and i ran it (without mongrel, and  
everything works fine),

then i followed the following tutorial:  
[http://blog.gwikzone.org/articles/2006/10/02/easy-setup-a-mongrel-cluster-with-apache-2-2-on-mac-os-x](http://blog.gwikzone.org/articles/2006/10/02/easy-setup-a-mongrel-cluster-with-apache-2-2-on-mac-os-x)  
to setup a mongrel cluster (im using linux instead of a mac, but it  
works the same), and I tested it, and rails loaded fine, however, when  
i went to:

[mysite.com/cgi-bin/test.pl](http://mysite.com/cgi-bin/test.pl)

i get a Service Temporary Unavailable problem.

Im assuming the problem is within my httpd.conf file, but I am not  
that familiar with it. Other than the stuff added in the tutorial  
above, I have the following cgi-related stuff:

ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”

\<Directory “/var/www/cgi-bin”\>  
AllowOverride None  
Options None  
Order allow,deny  
Allow from all

I am using apache 2.2.4 and mod\_perl 2.0

any help is greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 26, 2007, 6:04am UTC](https://www.ruby-forum.com/t/newbie-question-about-mongrel/92971/3 "2007-04-26T06:04:56Z")

</div>

On Apr 25, 2007, at 11:46 PM, removed\_email\_address@domain.invalid wrote:

> Previously we were using apache + mod\_perl, and my question is do i  
> still need to install mod\_perl, or is mongrel optimized to handle perl  
> in a fast fashion?

For this situation you’re probably best off continuing to use  
mod\_perl for the perl parts, and proxying the rails parts to mongrel  
instances.

> secondly, how do i run a cgi script when running rails, do i simply  
> put a cgi-bin directory in my public directory under my rails app, or  
> is it more complicated than that (i.e. modifying my httpd.conf file to  
> point somewhere other than rails/mongrel)?

If you’re using Apache then the perl-based things don’t need to be in  
the rails directory at all – use the Apache configuration to tell  
Apache where the cgi (or mod\_perl) scripts are and point the rest  
over to the proxy that talks to the mongrel servers.

-faisal
