views:

18322

answers:

22

What would you choose for a server used for web hosting, dns and email and why?

+1  A: 

I've personally been soured on using Linux as a server for production, due to some crazy behavior with shared memory and Postgres, so this is where I'd recommend FreeBSD instead. But, if it was between CentOS and Debian, I'd pick Debian every time. Why? RPMs are stupid. They've always been stupid, they always break, and using Apt is simply less hassle.

Derek
not RPM v apt flames again. Compare Yum v Apt and you'd have a good argument (you'd be wrong - they're practically the same).
gbjbaanb
+4  A: 

+1 Debian, but it's very subjective. Use whatever you know.

MattW.
Or, to get the best of Debian but in a more modern (my subjective opinion) wrapping, use Ubuntu if available. I had a server running on Debian and got fed up with what seemed to me a very conservative release policy. For example, MySQL 5 didn't turn up in their repositories for what seemed ages.
Hanno Fietz
There are pros to a conservative release policy, which can be very valuable for a mission critical server...
Stu Thompson
+1  A: 

At work, our sysadmin is putting CentOS on the new hardware (5 or 6 machines, I believe) and he loves it. On the other hand, a friend of mine runs Ubuntu Server Edition (which I believe is Debian based), and he loves it.

If you have a VM handy, perhaps install both CentOS, Debian, and a BSD distribution and see what you like and don't like about them. Then, pick the one that works best (or doesn't work the least).

Thomas Owens
Ubuntu is Debian based.
epochwolf
+5  A: 

+1 Matt Winkelmann, the standard advice: use whatever you know, and whatever your [friends|local group|girlfriend] knows.

That is, use whatever you know you can get good help when in trouble.

Both are good enough for a server, it will make more of a difference how the admin manages the distro than which distro is used.

If you are a newbie and are not familiar with any, refer to the standard advice.

Vinko Vrsalovic
+3  A: 

I have been using for awhile Debian64 on a x3650 IBM server. It runs MySQL, Apache(PHP, APC, mod_rewrite) and a DNS server. I had no problems with this install. Lately I have been playing with CentOS which is considered to be more "enterprise friendly".

Personally I like more the Debian way of package management. Anyway I believe the most important question you need to ask yourself when choosing an OS is how it will fit in the already existing environment. Consistency is very important.

Andrei Savu
+1  A: 

Try both of the distros, and try to "manage" the server for a week. You should be able to decide which one is better for you.

Every distro has pros and cons, also as Derek mentioned, try FreeBSD as well. It is the best I've worked with so far.

A: 

As others have said, it is very subjective, but I prefer CentOS. They are slower to release updates, but this seems to be based on additional testing for stability. If you're looking to always support the latest, greatest libraries, then CentOS may not be the right solution for you.

jvasak
If you need the latest release automatically updated by the OS then I believe Ubuntu is the best choice.
Andrei Savu
I thought people complain that Debian is slow to update packages (for the same reason). There are multiple versions of debian, including "stable", "unstable" and "testing"
dbr
+2  A: 

One benefit of CentOS is that since it's RHEL compatible commercial software like Oracle or WebSphere will run on it.

If you're sure you're only ever going to run OSS Debian would probably get my vote but having CentOS (and thus RHEL) skills will be great if you do ever want to run pay for software too.

Dave Webb
OTOH, most for-pay software runs fine on Debian, too, even though it's not officially supported. Just be aware that, if there are any problems, you're likely to have to troubleshoot them yourself.
Dave Sherohman
Alien works quite well for installing RPMs on Debian. Sometimes you have to search around to find the right library versions for it.
Mark Baker
+28  A: 

Both CentOS and Debian are good choices - so you won't go too wrong in either case.

CentOS uses RPM packages and is a repackaging of Red Hat Enterprise Linux. This means you will have a pretty smooth migration path if you wish to move to Red Hat at some stage in the future (or if your management require a "supported" Linux for some of their mission critical services). Most commercial software tends to be supplied as RPMs and to be "supported" on one of Red Hat or SuSE. CentOS, being a repackaged Red Hat should largely work ok with these commercial apps (unless they explicitly check the version and release of the OS which some do). CentOS is well maintained and, since it tracks RHEL, should quickly include patches and security fixes (particularly important for an internet-facing server).

Debian uses DEB packages (a different format to RPM which arguably has better dependency management and has been geared towards automatic updating over the Internet since the early days). Debian is put together by a community of volunteers rather than having the backing of any commercial organisation. This means that new versions of Debian are released when the community regards them as ready for public use rather than when shareholders expect a release. The benefit of this approach is that stable releases of Debian tend to be very solid. The downside is that stable releases of Debian don't always contain the latest and greatest versions of software. For an internet facing server this shouldn't be an issue - having battle-test software with the latest patches should be. Debian will provide this.

In summary, if you have no specific need for an RPM based solution - use Debian - the software is solid, they have a good security track-record and management of the system is easy once you learn how to use the tools. If you have a need for an RPM solution or plan on working with Red Hat at some stage in the future, use CentOS.

stephen mulcahy
A: 

The differences between OS are irrelevant. You can install and configure the same software on both. What is important is that you can configure it well.

Choose the one you know how to configure the best/easiest.

I've used Debian, and debian-based OS's the most, so I would choose Debian. If you had used CentOS, or other Red Hat based distros, use CentOS.

dbr
+1  A: 

Pick your applications first!

Then you can start looking at OSes that provide good support for them (e.g., they ship as part of the base distro, have a track record of providing timely security updates, etc.).

For example, if you want an open source IMAP server, then you have a variety of choices (Dovecot, Courier, Cyrus, etc.). Or if you want Outlook support, perhaps Zimbra....

A: 

It all depends on which distro you are most comfortable with. If you are more at home with Debian then go with it or else opt for CentOS. Both distros are mature products with a good community of developers and users behind it. And as stephen mentioned, you can't go wrong either way.

We have been using CentOS for everything you could imagine DNS, Web server, Database server, Mail server, Virtualization etc and so far we haven't faced any issues that would force us to look at any other distro.

Jahangir
+1  A: 

I run Debian on my own servers, because it's what I know best and am most familiar with (although I do believe deb is technically superior to rpm; it's not purely due to inertia).

However, I also work with a number of clients who run CentOS on their servers (usually because they're renting shared server space instead of running their own) and if you're not responsible for administration of the server, you can't really tell the difference unless you go looking. On the admin side, the tools are a bit different (the deb/rpm thing again), but I generally don't have too much trouble dealing with it - for the most part, just pretending that yum is apt-get usually works.

So, really, it falls back to the standard advice: Use what you know and are comfortable with. The only real exception I'd make to that is if you're trying to set yourself up for a job with a hosting company, in which case you should use CentOS, since that's what most of them seem to run.

Dave Sherohman
A: 

There was a time when Debian was definitely technically better, particularly in terms of package management. Red Hat, and therefore CentOS, have caught up a lot and there's really not a lot in it now.

I'd still choose Debian for my own servers if I could, but a) it is subjective and you might find you prefer CentOS, and b) you may need to run other software that is only supported on RHEL (and, officially supported or not, will work just fine on the almost identical CentOS).

Note that third party software you might want to run can include the hardware management software that comes with your server. Although HP now support Debian as well, their support seems a bit half hearted, with the web pages about it well hidden and the packages obviously thrown together by someone who doesn't know debian well.

Mark Baker
+2  A: 

I'd choose debian for one reason: upgrades. Not just security and basic bugfix package upgrades (those are handled nicely too, but CentOS and RH can say that now too, pretty much), but MAJOR upgrades. Try going from CentOS 3 to 4 or 4 to 5. Remotely. Now do the same with a debian machine. I suspect you'll have much more trouble upgrading CentOS than debian.

I've been running debian since approximately v0.96 and while one of the upgrades was a bit tricky (but, really, how often do you switch from a.out to ELF ?), the community was always very supportive, and in general things Just Worked. Which, IMO, is the most important thing you want out of the OS you put on a server (or servers) that are potentially at least a plane-flight away. (Which is something I've also done, and have not regretted)

The main downside is that yes, the release cycle is very long and slow, but that's what backports and the HOWTOs on backporting are for.

pjz
I'm scared of the upgrade from etch to lenny, because it requires an upgrade to the kernel (the libc in it requires linux 2.6), and while that's always worked fine for me in the past I don't fancy doing it on a leased server I have no physical access to.Otherwise I agree, debian upgrades are great
Mark Baker
@Mark: your server host should provide console access as to supplement ssh. If you have that, and the ability to boot a CD image (even if you need to arrange that the hosting company "insert" one) then you'll be fine even if trouble occurs. But Debian warns you of all the difficulties even on the most complex upgrades, and tells you what to do. All you need to do is read the instructions, make notes, and (worst case scenario, maybe) type and run an instructed command or two once the upgrade completes. That's a rare situation too, most upgrades are much simpler (fully automated) affairs.
Lee B
FWIW, I've done remote upgrades (of kernels even) on multiple debian boxes over the years, with few problems at all. If you're really paranoid you can look into grub's fallback-kernel option so that it will reboot into something sane if the upgrade doesn't work.
pjz
A: 

Both are great, I use debian because I like how its organised and the APT package management thing.

mnml
A: 

One point to consider is the lifetime of releases and especially security updates, especially if you are going to run services for many years. Upgrading a production server to the next major release is risky and takes a lot of work - regardless of the distribution.

Each CentOS version is supported for 7 years, which is quite a bit more than Debian's policy of promising security updates for one year after the next stable version is released. The Debian project is moving to time-based freezes, but this doesn't seem to help.

Ubuntu, on the other hand, releases LTS (long-term support) versions every two years. The current one was released on April 2008, next will be April 2010. They promise 5 years of support for servers.

See also: this comment in Server Fault.

nbr
A: 

I have been using Debian since the mid nineties and it's been great. Recently I've been switching to Ubuntu since it has many more packages and there are commercial support options from a good company.

For a new gig I'm using Centos, and I find there are a lot of missing packages, and many of the libraries are badly out of date. So what might be a 2 minute install turns into a day of installing libraries and dependant packages while reconciling them with what's already on the system, and that doesn't count managing security updates. I really want to have distro managed packages and libraries, so Debian/Ubuntu would be my strong suggestion, unless specific software indicates otherwise.

A: 

Its ford or chevy (or bmw or mercedes if you are higher end in your thinking). Pick a horse to ride and learn it inside out. If you have a generic problem, at least its only one set of problems instead of two. Applications may drive different needs, but at the end of the day its just a computer in the corner and all it has to do is what you tell it. Most of the time the problem is in the instructions, not the instructed.

A: 

Thanks for this thread, i am familiar with debian, however at home I run gentoo. At work there is now a discussion what to choose debian or Centos. I am not familiar with Centos at all or rpm, so I proposed debian. The reason why others won't take debian is we have some dell and HP hardware and as I read in this thread, both firms prefer .rpm than .deb. So that's a major issue for our business. Additionally I installed Centos5 in a virtualbox, and I don't like the policy assistant not asking me which packages are to be installed or not, so a usual CentOS installation is 2G big many packages i don't need as many, and the same debian installation is 500 MB big. However i managed to make a script which removes all unwanted software after the default installation on CentOS.

I agreee this decission is hard for me since I am not familiar with CentOS, but I think after some time of working with it I will like it. In the past I managed to move from debian to gentoo. And I love my gentoo meta-distribution it just works for me, however I would never use it in my business, it is just to hard for my collegues.

needle
A: 

Re: "This means that new versions of Debian are released when the community regards them as ready for public use rather than when shareholders expect a release."

That is the most uneducated, unresearched sentence ever made. Please don't conjure up conspiracy theories and post them as facts. it doesn't serve any useful purpose.

Madhatter
This probably would have been better as a comment to the answer (the first) than an answer itself.
James Skemp
A: 

I like Ubuntu server as a way to run Java servers. They pay attention to packaging, so everything is available via apt and configured in reasonable way. As a bonus, Ubuntu has great support for Amazon EC2 cloud

mikhailgarber