Testing Mongrel Configuration

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.

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)

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:inrun’
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. [email protected] 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.

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

[email protected]:/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:

[email protected]:/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.
[email protected]:/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.
[email protected]:/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” [email protected] 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


http://mongrel.rubyforge.org/
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.

On Fri, 13 Oct 2006 08:03:41 -0700 (PDT)
Will G. [email protected] 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


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

On 10/14/06, Will G. [email protected] wrote:

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

[email protected]:/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:

[email protected]:/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,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs