Which linux for nginx/mongrel?

Hi all! Well, I’m stuck again. I’m still trying to set up web servers
to run a mongrel cluster behind nginx. I’ve successfully setup Apache
2.2 with a 5 and 10 mongrel cluster on a Windows server for testing but
as a linux noob I’m having a hellish time just trying to compile and
install nginx on a linux box. I can’t even get past compiling.

:frowning:

I need some professional guidance again. I tried on CentOS 4.4 and now
on Fedora 6 and still no luck. I think I’m missing some basic elements
for compiling but I’m not sure what. I can’t seem to find any tutorials
that are detailed enough for what I’m trying to do.

So, I wonder now if I am even choosing the right linux flavor or if I’m
just overlooking some things. I see tutorials aimed at Debian, is this
the guy I should be using? Ubuntu? etc. Remember that I have 3 new
servers: 2 each Dell 1950’s (16gb ram, mirrored drives and 1 each Dell
2950 with 16gb ram and mirrored boot drives and a RAID5).

Any assistance is appreciated,

Raul

Raul - A suggestion: check out Litespeed (www.litespeedtech.com). It’s
very
easy to install, has native Rails support, and it really gives you 80%
of
the benefits for 20% of the effort (assuming you don’t want to become a
Unix
expert). If you have higher needs than that, I would recommend not
doing
everything yourself but choosing a high-end solution like EngineYard
(www.engineyard.com) where much of the management is done for you (and
you
are running and truly top-of-the line infrastructure).

Thanks for the response. Well my company bought me these brand new
servers
so I think I’ll try o give it a bit more effort before consider a hosted
solution but I thanks you for your honest suggestion. I’ve got lots of
systems admin experience so hopefully I can turn this to my favor with
linux.

Litespeed. Thanks for the link, I will check it out!

Raul

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Raul,

I second the recommendation for Litespeed. I tried it out on a memory

On 2/13/07, Mike Sax <[email protected] > wrote:

(and you
are running and truly top-of-the line infrastructure).


Thanks,

Dan


Dan K.
Autopilot Marketing Inc.

Email: [email protected]
Phone: 1 (604) 820-0212
Web: http://autopilotmarketing.com/
vCard: http://autopilotmarketing.com/~dan.kubb/vcard


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFF0pAi4DfZD7OEWk0RAsTGAKCvDxLeADkKe4w5pLjNAFxYiIyWTwCdF6IP
oSnfRuMpjVyQp0uaC48AxDE=
=u2Li
-----END PGP SIGNATURE-----

Hi Raul,

Whoops. Sorry about the first reply – hit the Send button too soon.

I second the recommendation for Litespeed. I tried it out on a memory
limited VPS and it performed the slightly better than Nginx/Mongrel.
The
ruby processes that Litespeed starts up use less memory than Mongrel

  • Rails,
    in my case at least.

Dan

On 13-Feb-07, at 7:37 PM, [email protected] wrote:

everything yourself but choosing a high-end solution like EngineYard
(www.engineyard.com) where much of the management is done for you
(and you
are running and truly top-of-the line infrastructure).


Dan K.
Autopilot Marketing Inc.

Email: [email protected]
Phone: 1 (604) 820-0212
Web: http://autopilotmarketing.com/
vCard: http://autopilotmarketing.com/~dan.kubb/vcard


Zed, that’s a great message! Definitely worthy of turning it into a blog
post for the rest of the world to enjoy.

Raul, one thing I didn’t mention about Litespeed is that it’s not open
source. The free version is mostly likely as much as you’ll ever need,
but
if you want a 100% open source solution, it’s not an option.

On Tue, 13 Feb 2007 15:06:41 -0800
Raul [email protected] wrote:

Hi all! Well, I’m stuck again. I’m still trying to set up web servers to run a mongrel cluster behind nginx. I’ve successfully setup Apache 2.2 with a 5 and 10 mongrel cluster on a Windows server for testing but as a linux noob I’m having a hellish time just trying to compile and install nginx on a linux box. I can’t even get past compiling.

Raul, looks like folks are trying to sell you stuff so I’m going to
give you some additional information so you can make an informed
decision.

THE BEST ADMIN BOOK EVER

Litespeed and EngineYard are both good decisions, but
eventually you’ll have to learn how to manage your systems anyway, so
you might as well learn it now.

Go get this book:

http://www.amazon.com/UNIX-System-Administration-Handbook-3rd/dp/0130206016

And then a few more on basic unix or any that people who bought that
book recommend. Notice I don’t make any referral bonuses off telling
you to buy this. This book taught me most of what I know about system
administration and is a great sysadmin cookbook.

Since this list is populated by system administrators who are infected
with Not Invented Here syndrome I’m sure you’ll get all of their
favorite Linux books. Use your favorite online book seller to check
out reviews and then buy one or two to learn from.

THE BASE PLATFORM

Remember you can use nginx or apache and be good, but at first you can
also just run Mongrel. In fact, if you’re struggling with Unix then
skip any other solution and just have Mongrel go stag to the party until
you need more.

If you have a Mac then follow these instructions:

If you’ve got Linux, then try Debian (god saying that makes me cry)
with Coda’s instructions:

http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/

And the Mongrel instructions:

http://mongrel.rubyforge.org/docs/debian-sarge.html

Plan on screwing this up about the first 10 times, erasing the whole
machine and starting over from scratch. After you do it from beginning
to end once without any mistakes you’ll have learned enough to really
manage the systems and take charge.

IRC HELP

Feel free to hit me up on irc.freenode.org in #rubyonrails. I’m zedas
there. I’m super nice to newbies.

PAST EXPERIENCE

I’ve run nginx and apache with mongrel on the following:

  • CentOS - Solid but you need to install more stuff via yum.
  • RHEL - Disgusting, avoid it since you end up rebuilding half the
    system.
  • FreeBSD - Very nice, haven’t used it in a while but easy to get
    all up.
  • ArchLinux - This is what I use. No hassles at all. Ruby is
    actually installed as ruby and with only one package.
  • OSX - Pretty simple once you get past using darwinports/fink to
    install requisites. Next version of OSX will include a full set of
    gear and then some.
  • Ubuntu - Eh, it’s Debian so follow the mongrel instructions for what
    packages to install, otherwise very usable.

Mongrel is also reported to work on nearly everything that Ruby works
on, including:

  • OpenBSD - I like these guys because they make fun of Debian too.
  • NetBSD - I haven’t tried this, but pkgsrc is pretty cool. Too bad it
    can’t build ruby for a damn on Linux.
  • Solaris - Apparently ruby gear runs real fast on Solaris, but that’s
    from Sun so pack your table salt.
  • Windows - Lots of folks use this.
  • Alien Spacecraft - But only if they don’t need really good IO.

And I’m sure there’s plenty I missed (so anyone else reading this just
keep your panties unbunched).

I also know most of the companies running Mongrel and they all run
their stuff on this range of OS. My informal survey says that CentOS
and Debian are the most popular.

HOSTING

I won’t play favorites so here’s a list of the companies I know of:

  • Engine Y.
  • Railsmachine
  • Media Temple
  • Rails Playground
  • Planet Argon
  • Joyent
  • Dreamhost
  • Textdrive

And I’m sure I’m missing some and have multiple companies confused with
each other since they constantly move around so people should feel free
to jump in and mention their companies. [Actually, if you’re running
Mongrel and offering hosting and I don’t remember you then you should
fire your entire marketing team and plan on being out of business in a
few months.]

BTW, Railsmachine and Engine Y. are the only two who’ve contributed
to helping Mongrel. Railsmachine (Bradley) did the mongrel_cluster and
railsmachine gems that are ultra handy while also donating money
towards the next version of Mongrel. Engine Y. (Ezra) did Merb and he
pioneered the nginx configurations as well as working on parts of
Mongrel.

If I’d recommend any it’s those two simply because they
actually help support the infrastructure that makes them money.

And no, writing a 6 paragraph blog post about bogus 4000 req/sec
performance metrics is not contributing.

BOOKS

I wrote a book so mine’s first, but you should check out all of them
and grab one or two if you need help in Rails deployment and
management. I highly recommend the O’Reilly Rails Cookbook because I
use the damn thing daily and Rob Orsini is a cool dude. I recommend my
book because it’s funny and useful. In fact I like all of these
authors so grab the ones that suit you. All of these books are also
available on the Safari bookshelf thingy except the Brazilian one.

http://www.awprofessional.com/bookstore/product.asp?isbn=0321483502&rl=1
http://safari.oreilly.com/0596527314
http://www.balanceonrails.com.br/
http://safari.oreilly.com/059652854X
http://safari.oreilly.com/0596101325
http://www.pragmaticprogrammer.com/ – search is broke.
http://www.awprofessional.com/promotions/promotion.asp?promo=3585&redir=1&rl=1

The pragmatic programmer’s have a small section on Mongrel in the
latest rails book, but the writing and instructions are garbage. Ezra
has a really good book coming out under pragprog on deploying rails but
I’m not sure if he’s finished it or if it’s in beta still.

And again I’m sure I missed some, so google around and wait for people
to yell at me for not pimping their stuff.

ADVICE

Thanks to Rails there’s more and more people like you being thrust into
managing Linux for the first time. Just like when you first started to
learn to code you’ll go through a period where you will suck and it’ll
be hard as hell. Keep going, keep reading, and keep breaking things
and then fixing them until you don’t break stuff anymore.

Running off to a commercial product isn’t bad, but it won’t help your
core problem which is a lack of knowledge of even basic tools. The best
situation is knowing your stuff and using a commercial product that
simplifies things for you. So learn to do this stuff right and then go
do the easy stuff–just like Calculus class. :slight_smile:

Otherwise, you can do very large very enterprise class installations
without shelling out anything more than your own time and learning
effort.

Good luck.


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

http://www.awprofessional.com/title/0321483502 – The Mongrel Book
http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 – Come get help.

Thanks for a great post Zed. I will spend sometime dissecting it.

Raul, I was in a similar boat. Over the last 10 years I have been a
professional software developer for Windows and done a smattering of
System
Administration of Windows machines. So I was confronted with a decision
when
I decided to become a Rails developer and knowing that I would be
deploying
to Linux (wanted to use VPS).

What I decided to do was format my harddrive and install Linux as my
main
operating system. No safety net, no going back. It was time consuming at
first and frustrating. But it really isn’t harder than Windows, just
different.

I have settled on Kubuntu as my distro of choice for development (Debian
based) as it is one of the simplest ones to get going and use. Get rails
and
development tools working was simple (plenty of step by step guides on
the
web).

I haven’t deployed anything yet, but I am increasing comfortable with
Linux so
won’t feel as intimidated when the time comes.

Cheers,

Anthony R.

Wow, thanks for the mentions Mike and Zed!

I’ll make an unabashed self-reference here and point out an extremely
informative ebook written by a couple of extremely handsome gents: :slight_smile:

http://www.oreilly.com/catalog/railsapp/index.html

Since I’m feeling particularly brazen, I’ll also mention that we
engineered modifications that were accepted into Capistrano 1.3 which
really help with “interesting” installations.

Zed, please contact us about funding. I had no idea you were taking
contributions. Can’t let that nice gent Bradley pull all the weight by
himself!

P.S. I disagree that you’ll eventually need to learn how to manage
your own systems. We have many customers who had applications written
and know nothing about managing Unix systems. :slight_smile: That said, the more
you know, the better off you’ll be, so by all means take Zed’s good
advice anyway.


– Tom M., CTO
– Engine Y.

On Wed, 14 Feb 2007 12:10:42 +0000
Sam A. [email protected] wrote:

Red Hat on the cover, which is clearly Linux! Oh, the confusion!)
Aha! Sam, right you are. I forgot that the Linux one is more recent
even though it has a 2nd edition rather than 3rd. The UNIX handbook is
great if you have to manage a bunch of the weirder older systems.


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

http://www.awprofessional.com/title/0321483502 – The Mongrel Book
http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 – Come get help.

On Wed, 14 Feb 2007 08:56:13 -0000
[email protected][email protected] wrote:

Wow, thanks for the mentions Mike and Zed!

Not to be a dick Tom, but I actually mentioned Ezra. If you helped
write the code he cranks out and contributes then sorry. Otherwise, I
was praising EY because of Ezra’s work.

contributions. Can’t let that nice gent Bradley pull all the weight by
himself!

Bradley also bought me a sweet iPod nano red that helps fight AIDS and
with the engraving “Faster Is Possible, Thanks for Mongrel”. That’s way
more kick ass than money, that’s someone just being nice. Or how Apple
gave all the people who contributed to Mongrel free OSX seed keys and a
trip to WWDC.

I think the worst was someone who insisted on buying me a drink even
though I insisted I don’t drink.

Anyway, I’ll plan hold you to that offer if/when I start doing the 2.0
plan.

P.S. I disagree that you’ll eventually need to learn how to manage
your own systems. We have many customers who had applications written
and know nothing about managing Unix systems. :slight_smile: That said, the more
you know, the better off you’ll be, so by all means take Zed’s good
advice anyway.

Yeah, guys like me are a dying breed. I couldn’t imagine being a slave
to someone else because of intellectual laziness.


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

http://www.awprofessional.com/title/0321483502 – The Mongrel Book
http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 – Come get help.

Zed,

THE BEST ADMIN BOOK EVER

Go get this book:

http://www.amazon.com/UNIX-System-Administration-Handbook-3rd/dp/
0130206016

Is there any reason you recommend this particular book? On looking
around Amazon, I found this:

http://www.amazon.com/Linux-Administration-Handbook-2nd-Nemeth/dp/
0131480049/sr=1-1/qid=1171454843/ref=pd_bbs_sr_1/105-6108692-8598807?
ie=UTF8&s=books

Which looked to be a bit more recent, and by the same (similar) authors.

Would you still push for the UNIX handbook? (Even though it mentions
Red Hat on the cover, which is clearly Linux! Oh, the confusion!)

Sam A.


I love this post! Spicy, extra crispy as they say in the fried chicken
biz.

I REALLY appreciate the frank advice that everyone has contributed to
this
post going on down throuhg all the responses. And I’m excited about the
fact that all the folks who created all the stuff I’m trying to use or
read
from are right here - accessible to me and others needing help!

Ok back to the task at hand, I already bought Rails Cookbook (just got
it 2
days ago and it’s fantastic!) as well as the Pickaxe, Agile Web Dev 2nd
edition (already read most all of it and it’s working), Rails Recipes
and
Ajax on Rails (for the near future). I’m already feeling very
comfortable
with Rails development so it sounds like the missing link is just a good
linux reference. I’ll look into that second book mentioned.

Having many years of enterprise sys admin experience (now mostly free to
focus on web development - yay!) I’d rather be more closely aware of
what my
servers are running and be able to maintain them. I also have to give
our
IT dept’s Sys Admin a crash course on this stuff after I document a
fully
successful deployment on one machine so he can go on to setting up and
administering all the others. Then I’ll be on to the next
step…Capistrano. It seems like a tall mountain to climb but the CEO
is
very impulsive and impatient so I think I’d rather be Agile on the
development end of things rather than on the deployment end. Hence, I
chose
Rails over PHP and .NET, both of which I’ve already been using for quite
some time. This way I can keep dev time to a minimum and flexibility of
design to a max.

Thanks again for the honesty and guidance. I’m going forward now,
trying
out a couple of more linux flavors…

Raul

----- Original Message -----
From: “Zed A. Shaw” [email protected]
To: [email protected]
Sent: Wednesday, February 14, 2007 2:34 AM
Subject: [Rails-deploy] Re: Which linux for nginx/mongrel?

First of all, this is my first post to this group and I’d like to
thank whomever started this bad boy up. I’ve been watching via daily
abridged updates that Google sends and I couldn’t be happier – real
world advice from real world rock stars!

Zed, thanks for the post above. A lot of great information in one
place.

Yes, you can make it without knowing Linux/Unix if you go with a
hosted solution like EY or the like but you’ve got nothing to lose by
learning as much about your deployment environment as possible. This
helps you communicate problems or issues a little better because you
know what’s going on underneath the hood. And, as far as I know, most
people find this kind of learning actually enjoyable. :wink:

Another thing … I’d like to thank Zed and Tom for both taking part
in O’Reilly’s Shortcuts dealio. It’s awesome to be able to get so
much golden information in one small, compact source. The Shortcuts
are a major reason why I’m a subscriber to the Safari service and I’m
always stoked when Rails-related information comes across the radar.

The Shortcuts I’m talking about…
Mongrel:
Serving, Deploying, and Extending Your Ruby Applications

and
Capistrano and the Rails Application
Lifecycle

Again, thanks guys. With your help, I’m looking forward to launching
some production apps in the very near future!

-Chris

On Feb 14, 8:35 am, “Zed A. Shaw” [email protected] wrote:

On Wed, 14 Feb 2007 08:56:13 -0000

[email protected][email protected] wrote:

Wow, thanks for the mentions Mike and Zed!

Not to be a dick Tom, but I actually mentioned Ezra. If you helped
write the code he cranks out and contributes then sorry. Otherwise, I
was praising EY because of Ezra’s work.

Have I done something to anger you that I don’t know about?

I meant thanks for the Engine Y. mentions, and I was clear you were
praising Ezra’s work. We encourage and support his work in all ways.

The mention I was thank you for was: “BTW, Railsmachine and Engine
Yard are the only two who’ve contributed to helping Mongrel.”

As a founder of Engine Y., I felt entirely OK about thanking you for
that mention. Not entirely sure why the clarification was necessary,
and definitely not sure why you did it in a way that seems to suggest
I was stealing Ezra’s glory, or misrepresenting what you said.

P.S. I disagree that you’ll eventually need to learn how to manage
your own systems. We have many customers who had applications written
and know nothing about managing Unix systems. :slight_smile: That said, the more
you know, the better off you’ll be, so by all means take Zed’s good
advice anyway.

Yeah, guys like me are a dying breed. I couldn’t imagine being a slave
to someone else because of intellectual laziness.

I entirely agreed with your recommendations, calling it good advice.

I have never once considered my customers slaves, nor do I consider
someone who decided to pay someone else for their expertise a slave.

I’d be surprised if my customers consider themselves slaves. In fact,
many of them have expressed that running their own servers 24x7
previously was as close to slavery as they care to get. :slight_smile:


– Tom M., CTO
– Engine Y.

First of all, this is my first post to this group and I’d like to
thank whomever started this bad boy up. I’ve been watching via daily
abridged updates that Google sends and I couldn’t be happier – real
world advice from real world rock stars!

Zed, thanks for the post above. A lot of great information in one
place.

Yes, you can make it without knowing Linux/Unix if you go with a
hosted solution like EY or the like but you’ve got nothing to lose by
learning as much about your deployment environment as possible. This
helps you communicate problems or issues a little better because you
know what’s going on underneath the hood. And, as far as I know, most
people find this kind of learning actually enjoyable. :wink:

Another thing … I’d like to thank Zed and Tom for both taking part
in O’Reilly’s Shortcuts dealio. It’s awesome to be able to get so
much information in one small, compact source. Seriously, those
things are gold. In fact, the Shortcuts are a major reason why I’m
a subscriber to the Safari service and I’m always stoked when Rails-
related information comes across the radar.

The Shortcuts I’m talking about…
Mongrel: Serving, Deploying, and Extending Your Ruby Applications
( O'Reilly Media - Technology and Business Training )
and
Capistrano and the Rails Application Lifecycle (
O'Reilly Media - Technology and Business Training
)

Again, thanks guys. With your help, I’m looking forward to launching
some production apps in the very near future!

-Chris

Hi everyone. I just wanted to report back my progress after following
some
of the great suggestions here, in combination with info at the Mongrel
site,
deployment instructions in the Rails Cookbook and various other web
resources found via Google.

This is what I have so far:

  • I feel MUCH more confortable with linux now after extensive reading
    and
    experimenting!
  • I ended up running CentOS 4.4 because it was the only one I could get
    to
    recognize all my hardware straight away (tested with Debian, Ubuntu,
    Fedora
    Core 6 (got my hardware but didn’t recognize over 3gb of my 16gb of ram
    and
    finally CentOS)
  • I’ve got nginx 0.5.12 running from an RPM I found online (much easier
    than
    having to figure out the compilation prereqs, I’ll get to that I
    promise!)
  • installed Ruby, RubyGems, Rails, mongrel_cluster and Mongrel (I
    learned
    all about using yum for some package management too)
  • used Ezra’s nginx.conf with some minimal tweaks for file paths
  • got nginx and Mongrel auto starting on reboot

In all this I learned about RPM, yum, chown, tar, cp and general
browsing of
the folder/file structure. I think I’m starting to get it.

Now I have Nginx responding at http://localhost and from any other PC in
my
network (from http://172.x.x.x) as well so that’s good. I also have
mongrel
responding with my default Rails app on all the ports I chose locally
though
not yet from browsers on other PCs though I’m not sure what’s causing
this
just yet. So it’s on to the next step of setting up Subversion,
Capistrano
and then play around with Xen to get everything up on virtuals. And
also
setup my MySQL server the same way. The wonderful world of database
replication. I’d like to see what Linux boxes can do with clustering
too…

Too ambitious? Probably!

Thanks again,

Raul