# Testing Mongrel Configuration

**URL:** <https://www.ruby-forum.com/t/testing-mongrel-configuration/72010>\
**Category:** Rails\
**Created:** [October 13, 2006, 5:07pm UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010 "2006-10-13T17:07:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 13, 2006, 5:07pm UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/1 "2006-10-13T17:07:22Z")

</div>

Hello all,  
I’m trying to get mongrel set up under Apache, but first I’d like to  
test Mongrel to make sure it is set up correctly (before going through  
all the trouble with Apache).

I’ve done the following so far:

1. Installed Mongrel
2. Set up a Rails site called test
3. Added a file called test.config to my /etc/mongrel/sites-enabled/  
directory.
4. Started Mongrel

I then did the following to start Mongrel  
sudo /etc/init.d/mongrel start test

And received the following error message:  
line 43: /etc/mongrel/sites-enabled/test: No such file or directory

Here are the contents of my /etc/mongrel/sites-enabled/test.config file:  
#RAILS\_ROOT of your application  
dir=/home/wgant/Desktop/test  
#port the first mongrel instance should listen to, additional instances  
listen to ports above  
port=8100  
#number of instances  
servers=3  
#port pen will listen on  
proxy\_port=8001

Any thoughts? I imagine that it’s probably something simple, but I don’t  
know what it is.

* * *

Do you Yahoo!?  
Get on board. You’re invited to try the new Yahoo! Mail.

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 13, 2006, 6:52pm UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/2 "2006-10-13T18:52:08Z")

</div>

On Oct 13, 2006, at 8:03 AM, Will G. wrote:

> #port the first mongrel instance should listen to, additional  
> instances listen to ports above  
> port=8100  
> #number of instances  
> servers=3  
> #port pen will listen on  
> proxy\_port=8001

You seem to be trying to use mongrel\_cluster, not mongrel per-se…

To debug, skip the init.d script and try starting directly:

mongrel\_rails cluster::start -c /etc/mongrel/sites-enabled/  
test.config

At Engine Y., we use a very simple mongrel\_cluster.yml file:

cwd: /part/to/rails/root  
environment: production  
port: 5000  
servers: 3

I think it’s interesting that your config file uses ‘dir:’ where ours  
uses ‘cwd:’. I don’t use pen, but I find it fascinating that pen  
configuration is in the mongrel\_cluster config file, but perhaps that’s  
correct.

–  
– Tom M., CTO  
– Engine Y., Ruby on Rails Hosting  
– Reliability, Ease of Use, Scalability  
– (866) 518-YARD (9273)

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 13, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/3 "2006-10-13T23:04:06Z")

</div>

I tried the command that you suggested. Here’s the output:  
sudo mongrel\_rails cluster::start -c  
/etc/mongrel/sites-enabled/test.config  
/usr/lib/ruby/gems/1.8/gems/mongrel\_cluster-0.2.0/lib/mongrel\_cluster/init.rb:30:in  
`merge!': can't convert String into Hash (TypeError) from /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.0/lib/mongrel_cluster/init.rb:30:in `run’  
from /usr/lib/ruby/1.8/mongrel/command.rb:203:in `run’  
from /usr/bin/mongrel\_rails:232

Just to clarify things for myself a bit. The test.config file is the  
file I included with the previous message. I don’t have a  
mongrel\_cluster.yml file. Should I have one, and if so, where?

Thanks,  
Will

Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
On Oct 13, 2006, at 8:03 AM, Will G. wrote:

> #port the first mongrel instance should listen to, additional  
> instances listen to ports above  
> port=8100  
> #number of instances  
> servers=3  
> #port pen will listen on  
> proxy\_port=8001

You seem to be trying to use mongrel\_cluster, not mongrel per-se…

To debug, skip the init.d script and try starting directly:

mongrel\_rails cluster::start -c /etc/mongrel/sites-enabled/  
test.config

At Engine Y., we use a very simple mongrel\_cluster.yml file:

cwd: /part/to/rails/root  
environment: production  
port: 5000  
servers: 3

I think it’s interesting that your config file uses ‘dir:’ where ours  
uses ‘cwd:’. I don’t use pen, but I find it fascinating that pen  
configuration is in the mongrel\_cluster config file, but perhaps that’s  
correct.

–  
– Tom M., CTO  
– Engine Y., Ruby on Rails Hosting  
– Reliability, Ease of Use, Scalability  
– (866) 518-YARD (9273)

* * *

Get your own web address for just $1.99/1st yr. We’ll help. Yahoo! Small  
Business.

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 14, 2006, 8:14pm UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/4 "2006-10-14T20:14:38Z")

</div>

I tried creating the config file as you suggested. I think something  
else may be broken:

wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
test.config -e production  
!!! Path to log file not valid: log/mongrel.log  
start reported an error. Use mongrel\_rails start -h to get help.

I then tried the following:

wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
test.config -e production -l /home/wgant/mongrel.log  
!!! Path to pid file not valid: log/mongrel.pid  
start reported an error. Use mongrel\_rails start -h to get help.  
wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
test.config -e production -l /home/wgant/mongrel.log -p  
/home/wgant/mongrel.pid  
!!! Path to pid file not valid: log/mongrel.pid  
start reported an error. Use mongrel\_rails start -h to get help.  
wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
test.config -e production -l /home/wgant/mongrel.log -P  
/home/wgant/mongrel.pid  
!!! Path to docroot not valid: public  
start reported an error. Use mongrel\_rails start -h to get help.

By the way, are you “the” Zed that wrote Mongrel?

Thanks,  
Will

“Zed A. Shaw” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
On Fri, 13 Oct 2006 08:03:41 -0700 (PDT)  
Will G. wrote:

> 

Don’t write your own config file by hand, use the -G option to Mongrel  
so that it gets generated correctly. You can then modify it from there.  
You do it like this:

mongrel\_rails start -G test.config -e production …

(where … is any other options you need)

It’ll then tell you it created test.config and you just need to run it  
with:

mongrel\_rails start -C test.config

And that’s it.

–  
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.

[http://mongrel.rubyforge.org/](http://mongrel.rubyforge.org/)  
[http://www.lingr.com/room/3yXhqKbfPy8](http://www.lingr.com/room/3yXhqKbfPy8) – Come get help.

* * *

Get your own web address for just $1.99/1st yr. We’ll help. Yahoo! Small  
Business.

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 14, 2006, 2:52am UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/5 "2006-10-14T02:52:49Z")

</div>

On Fri, 13 Oct 2006 08:03:41 -0700 (PDT)  
Will G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

Don’t write your own config file by hand, use the -G option to Mongrel  
so that it gets generated correctly. You can then modify it from there.  
You do it like this:

mongrel\_rails start -G test.config -e production …

(where … is any other options you need)

It’ll then tell you it created test.config and you just need to run it  
with:

mongrel\_rails start -C test.config

And that’s it.

–  
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.

[http://mongrel.rubyforge.org/](http://mongrel.rubyforge.org/)  
[http://www.lingr.com/room/3yXhqKbfPy8](http://www.lingr.com/room/3yXhqKbfPy8) – Come get help.

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [October 17, 2006, 2:04am UTC](https://www.ruby-forum.com/t/testing-mongrel-configuration/72010/6 "2006-10-17T02:04:32Z")

</div>

On 10/14/06, Will G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I tried creating the config file as you suggested. I think something else  
> may be broken:
> 
> wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
> test.config -e production  
> !!! Path to log file not valid: log/mongrel.log  
> start reported an error. Use mongrel\_rails start -h to get help.

Are you calling this from within a Rails application’s root (doesn’t  
look  
like it)? You should be.

Matt

I then tried the following:

> wgant@sauron:/etc/mongrel/sites-enabled$ mongrel\_rails start -G  
> test.config -e production -l /home/wgant/mongrel.log -P  
> /home/wgant/mongrel.pid  
> !!! Path to docroot not valid: public  
> start reported an error. Use mongrel\_rails start -h to get help.
> 
> By the way, are you “the” Zed that wrote Mongrel?

He answers to many names. “Zed” is one of them.

Thanks,
