Mongrel in development

A newbie Q here…

In the default leopard env. Is mongrel serving dev rails apps without
sitting behind apache?
In know on a production env apache or nginx etc. Is a required part of
the stack. The reason I ask is, when I shut down apache on my dev
machine script/server still works.

Any insight on this?

Thanks, Elliott

On Wed, Aug 19, 2009 at 09:04:52AM -0700, elliottg wrote:

A newbie Q here…

In the default leopard env. Is mongrel serving dev rails apps without
sitting behind apache?
In know on a production env apache or nginx etc. Is a required part of
the stack. The reason I ask is, when I shut down apache on my dev
machine script/server still works.

script/server starts a single process (mongrel, webrick etc) which you
connect to directly. You don’t need to have apache, nginx or any other
webserver running.

I moved away from script/server when passenger made it so easy to
develop
using apache, but you can stick with script/server as long as you like.
Whatever is easier in your situation.

HTH

Matt H.

Thanks Matt.

That clears some things up for me. I didn’t realize Mongrel could
stand alone. I am actually trying to switch over to Passenger as that
will be my new Production env. and I want to develop in a similar
env… I am having some issues getting Passenger running though cause
of some system issues on my machine.

What’s your thoughts on running Mongrel on my dev box and Passenger in
production?

Thanks man.

On Aug 19, 1:22 pm, Matt H. [email protected]

I hear you on that. Thanks for your time!

EG

On Aug 19, 1:38 pm, Matt H. [email protected]

On Wed, Aug 19, 2009 at 10:29:57AM -0700, elliottg wrote:

production?
Mongrel used to be very popular before passenger came along. You could
run
many mongrel processes on different ports, then have apache or another
webserver/load balancer route the requests to them. This made the
applications multi-threaded.

Now a lot of people use passenger which requires less maintenance and
setup,
and does pretty much the same thing quietly.

As for your last question…I’m not an expert but I’m guessing that you
might one day run into a problem on passenger that didn’t happen on
mongrel
in development (or vice versa). Ideally I think you should be using the
same
software on both dev and prod, but that’s maybe just me.

I think it depends a lot on your applications, if you are using complex
gems
or features, then developing on different server software might cause
you
problems when you deploy to production.

These are just how I see things, others may well have different views.

Matt H.

Elliott G. wrote:
[…]

What’s your thoughts on running Mongrel on my dev box and Passenger in
production?

That’s what I do. It hasn’t been a problem at all. I don’t really see
much point in putting Passenger on my laptop.

Maybe if I had a computer that I used only for Web development (for
example, if I had an office job), things would be different. But I just
don’t see much advantage, since Passenger doesn’t appear to mess with
the apps it serves.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Elliott G. wrote:
[…]

What’s your thoughts on running Mongrel on my dev box and Passenger in
production?

That’s what I do. It hasn’t been a problem at all. I don’t really see
much point in putting Passenger on my laptop.

Same here. I use mongrel for development mostly because I don’t
generally run Apache at all on my development box. I don’t see the point
of having Apache/Passenger running all the time just to run my Rails
apps.

This is pretty much all about user preference, so do whatever you find
works for you. I just try to run as few services on my development
machine as possible and Apache is not generally requires. I don’t browse
web sites stored on my own laptop. I figure the fewer services I have
running, the more secure my environment is for day-to-day use. Not that
I’m concerned about the security of Apache.

That being said, I’m sure there are some advantages of running
Apache/Passenger on your development box, but I don’t think application
server differences are going to be a major issue. I would expect to have
more issues in production, but due to load rather than what application
server is used.

Matt H. wrote:

Ideally I think you should be using the
same software on both dev and prod, but that’s maybe just me.

While I see some merit to this, there is actually some advantage to
having different environments for development and production.

  1. I happen to develop on a Mac, which provides me with a lot of design
    tools, and an excellent development environment that I find advantageous
    over other alternatives. However, I generally deploy to Linux servers.

  2. Having different environments helps to ensure that I’m not creating
    issues that might bind me to a specific deployment environment. I even
    tend to use a different database in development than what I use in
    production. This helps ensure that the code I write is database
    agnostic.

I do think that a staging server that matches your production
environment would be very useful for critical web sites.

On Wed, Aug 19, 2009 at 09:04:52AM -0700, elliottg wrote:

In know on a production env apache or nginx etc. Is a required part of
the stack.

Actually, this is not entirely true, but it might as well be. You could
very well run a production application directly with Mongrel, or Thin or
whatever. This would be rather silly, but it’s certainly possible if the
traffic is low enough.