What would you choose for a server used for web hosting, dns and email and why?
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.
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).
+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.
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.
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.
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.
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.
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.
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....
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.
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.
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.
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.
Both are great, I use debian because I like how its organised and the APT package management thing.
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.
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.
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.
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.
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.
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