FreeBSD: The best server OS.

I've configured and maintained over 100 UNIX-based servers over the years starting with Slackware Linux 2.0 back in 1995.  Over all course of all the deployments I've become very biased about my operating systems.  Linux clearly has a solid lead with desktop applications, but for server deployments and maintainability, I believe firmly in FreeBSD.

When talking about operating systems, there are a lot of points to debate about.  The big deal used to be which one was more stable and which one supported the crazy file system configurations none of us normal people will ever use.  Well, they are all fairly stable now (yes, even Windows) and honestly who is going to set up 10 machines with a distributed ReiserFS?  People today seem to be obsessed with micro kernel details such as the process scheduler, something you may never understand and probably will never see a significant performance change from switching on.  This leaves me with the real issues, such as:

1) Upgrades
    How hard is it to upgrade software? 
    How seamless is it? 
    How much pain must you go through? 
    How much specialized knowledge is involved?

2) Software Compatibility
    Does software compile/run easily for this platform? 
    Where do I get it? 
    Does it integrate easily? 
    Do I need specialized knowledge to do this?

3) Configurability
    How hard is it to make the changes I want to? 
    How do I help myself learn the OS? 
    Is everything fairly standard? 
    Do I lose my changes when I upgrade?

Obviously different distributions of Linux have different scripts and standard locations so it's slightly difficult to compare apples to apples here but I'll do my best basing my experience off of Slackware, Debian, Redhat, Gentoo, Mandrake and Ubuntu.  I'd also like to note that Windows isn't included in this comparison simply because it follows a completely different paradigm.  One of my serious server OS requirements is that the OS allows for extensibility, that is, adding functionality easily where it didn't previously exist, which, through Windows, is virtually impossible without purchasing additional software.  UNIX-based operating systems are fundamentally extensible.  I'll write another article on that later.

FreeBSD has a very standard directory structure:

/boot -> kernel and any other bootable files
/root -> The user, "root", home directory
/bin -> System binary executables runnable by root and normal users
/sbin -> System binary executables runnable only by root
/lib -> System shared library files
/var -> Logs, runtime process locks
/etc -> System configuration
/tmp -> Temporary files
/usr -> Userland files (non-system)
/usr/home -> Users' homes
/usr/lib /usr/bin /usr/sbin -> Same as previous except non-system
/usr/local -> Userland files specific to the local installation
/usr/local/lib /usr/local/bin /usr/local/ec -> Same as previous except for locally installed applications

Given this, I could tell you where any configuration file may be depending on if it's system-level (such as a boot-up sequence) or if it's an installed application (like apache).  While Linux distributions also support this, they often times don't strictly adhere to it, as in, you will find many packages' binaries installed into /usr/bin where in FreeBSD they'd certainly be in /usr/local/bin.  Linux also tends to put all configuration for almost everything in /etc.  For this reason I feel that FreeBSD is more disciplined and easier to work with.

Here is the official FreeBSD directory structure description

Configuring and updating the operating system:

rc.conf.  /etc/rc.conf is the file read by all startup scripts to determine if they are allowed to start and if so, what the flags are for starting.  rc.conf is very human readable and you can easily turn on and configure any supported service in it.  If you need to know what flags or options are available, you just look at /etc/defaults/rc.conf.  I always find what I need for start up there.

FreeBSD can be fully updated and recompiled via CVS.  There is a utility called CVSUP which allows for you to update just one part of the operating system or the entire system.  I've known people to script a nightly update and build that downloads the latest source for their branch of FreeBSD, recompiles and reboots every single night.

Installing applications via the ports tree:

FreeBSD pioneered the ports tree and it still works well.  What is the ports tree?  It's a collection of software sources configured and patched for FreeBSD.  The way to install one is to go to the port and run "make install."  It's very simple.  It also installs all dependent applications as it goes.  Gentoo had a similar system in which you could emerge ports.  It was based on the same basic concept as this.  Ports tree too old?  Update it in one command with CVSUP (mentioned previously).

Other Technologies:

Linux Compatibility:  Yes, FreeBSD offers Linux Compatibility.  You can natively run linux binaries with the support installed and enabled.  I've done this to run versions of Java that aren't able to be compiled natively for BSD.

Networking & Files:  FreeBSD's ipfw is a fantastic tool.  I use it for all my packet queuing, firewalls, logging and any other network gateway-related activity.  It can do almost anything.  FreeBSD also features a journaled filesystem and some recovery tools which have saved me from devastating data loss in the past.

Summary:

I'm not going to get into all of the other reasons I prefer using UNIX, because there are too many, but specifically for FreeBSD, these small things add up to big savings in administration time and less headaches.  I try not to get too focused on one specific technology when evaluating an operating system.  I try more to look specifically at where the savings are for me.  I simply want the operating system to support what I'm trying to do in the least amount of time feasible and I believe FreeBSD does that for me.  If you're pragmatic and functional and are willing to learn a little UNIX, I highly recommend giving FreeBSD a try as your server operating system.

23 Comments

Post a comment here or discuss this and other topics in the forums

A bad OS, is the one when you

A bad OS, is the one when you are compiling a new compiler version, after 2 hours, it fails because of lack of space (it could had tried to delete logs and temp files first, or at least tell me before it was too late), and suddenly you get all your files marked as read only. Sorry Linux but I got tired of you, tomorrow I will change to FreeBSD.

P.D: Kernel 3.2.1 makes you experience a weird bug with Intel x3100 vga, you see words desapearing at random, and you have to put something in top of it to make it appear again. About windows of firefox has overlapped fonts. Console of Xfce has now overlapped fonts...

re: FreeBSD

Personally FBSD kicks serious a$$ .. I got board with linux after rh4 and have been an avid BSD fan, (free and Open BSD) for a workstation, that requires 0 money (granted considering the usability and stability of it PLEASE throw 20$ at ANY of the BSD flavors)

I use FBSD-amd64 8.2 on my dule core 1.66ghz laptop with 4 gigs of ram, running a quad desktops with over 40 applications and servers running (cups/apache/pure with 20-30 applications such as gimp, opera and similar) I still can NOT break over 1 gig of REAL ram used.. I don't even touch swap space EVER.

Theres 2 real differences (imho) that REALLY sets BSD above the rest..

oddly enough they can be summed up in 3 words..

#1 - Security (especially OpenBSD by default)
#2 - PF
#3 - EULA

PF (Packet Filtering) is SUPER powerful and offers unmatched security over any linux flavor. (its unique to BSD because (in short) of the networking stack.

EULA - The freedom of freebsd is AWESOME.. Unlike a linux based distro the BSD end user agreement offers the ultimate in freedom.. If I want to modify ANYTHING I can do so without any recourse.. (oddly enough people think linux is open source, however if you read the fine print ONLY the kernal is) this is NOT the case with the BSD version.

there are other differences, but the bottom line is if security, networking, (and load balancing) combined with a powerful desktop workstation is what you need.. GET BSD.

re: FreeBSD: The best server OS.

I agree that it is the best server OS, but it is certainly not the easiest to manage.

If you have one or a few systems then the overhead is manageable. Bur for management en masse, nearly all linux distributions can smoothly, and without re-compilation, update the system to the newest minor release of the OS, and you can do this for hundreds of systems at once from precompiled binaries (no source compilation required).

Some OS's like CentOS (and i presume RedHat) and Ubuntu can seamlessly upgrade major releases from precompiled binaries also. With FreeBSD whenever you update the base OS you have to recompile the binaries from source, for every system, which can take a very long time.

When you recompile the base os you then have the potentiality for broken ports and/or library dependency hell if the base OS upgrades a commonly used library. In this case FreeBSD keeps a copy of the old library, but it you ever want to clean out the old libraries, you need to rebuild *every single port* after upgrading the ports tree to get the new library dependencies.

So i agree a great OS, but built by/for programmers, without much concession to automated management tools, if you have hundreds of machines then you cannot use FreeBSD, unless you are not going to bother patching the base OS (just upgrade the ports). Running a script to upgrade is great, but not when you have to schedule outages for weeks ahead of time.. and then hopefully there are no problems with the base OS or ports tree and being pages at 4am the next morning ?

Given the stability of *BSD, not patching the base OS and (re)installing from ISO releases and updating the ports tree is not as crazy as you might think. I would not even consider this approach with any other operating system, but *BSD releases are usually pretty solid, security and vulerability wise.

I recently came across your

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don¡¯t know what to say except that I have enjoyed reading.Nice blog,I will keep visiting this blog very often.

FreeBSD best Server OS

I using FreeBSD since 1997...and happy with it, good security, fast, easy to maintain...grate up-time, don't forget - Linux, any of them , is not a UNIX it's a clone of UNIX (started from RH - exact copy of FreeBSD)
Thanks, Ross
PS: not saying that linux is bad, just, than longer you use BSDs, than less you wanna switch to something else.

When you run 5 server jails

When you run 5 server jails (yes 5, tinderbox, email, web, mysql and dns) it makes sense from an administration standpoint to use BSD. With a Linux box it's impossible for me to write an automated script to update all the packages I have because every little utility is its own separate package, depending on the flavor. With BSD I can write a small script (~50 lines) to pull the latest -STABLE from cvs, compile it, package it, and then distribute it to all of my jails, and install it to the base system including kernel, then run a reboot. This is where BSD really shines is the separation of ports from its basic system.

medyum

Dear Robert,I've found your arguments quite interesting. My experiences are with the management of Debian GNU/Linux and FreeBSD servers (home and small businesses).Pros for FreeBSD : excellent documentation, impressive stability, lean but complete inital setup, i LOVE rc.conf.Pros for Debian : packages choice, OS upgrades are so smooth with aptitude, OS virtualization with linux-vserver/open-vz is clearly easier to manage than BSD jails.Pros for both environments : gcc support, easy initial installation, robust default filesystem (UFS2 or EXT3), easy installation of packages, easy application of security updates (for default kernels).My conclusion : FreeBSD and Debian/Linux are really fine OS and, for my part, I found it more and more difficult to choose between them. We are blessed to have free access to these OS and their respective communities!

not getting the 'easy to upgrade' appeal

Easy to upgrade? Compared to what?

For a small handful of servers, sure: it's easy to keep up to date. But if you end up with a small number of out-of-date systems or a large number of FreeBSD systems, your management responsibilities are significantly more complex. FreeBSD requires a lot more time "behind the wheel" to do things than something like Debian or RHEL - not so much the configuration, but system lifetime maintenance. (This largely seems to be related to the source nature of release/upgrade, as well as the separation of "world" from "ports".)

For instance, getting 10 Debian systems from 3.1/4 to 5 was much, much easier than moving a half dozen FreeBSD systems from 6.1-7.2 to 8 with up-to-date/secure ports collection installs. Maintaining system cohesion and rebuild documentation (you know, proper system admin tasks) requires much, much work due to inherent limitations/design choices in the various "package" tools on FreeBSD.

And then we've got the issue of system migration: when that old FreeBSD 5 box needs to be replaced, do you use dump to migrate to new hardware? Do you do a new install and try to dig through /usr/local/etc/ and /etc to try to figure out what gets installed where? Having a single directory to pull for all system configuration (/etc) makes a hell of a lot more sense to me. Whether it's "system" or "userland" seems to be an inconsequential point: a "system" is, in reality, somewhat more than just what takes the kernel to boot. What's significant is the services said server provides.

Nevermind figuring out if there's any truly third party software on the system: what's wrong with /opt? And the RedHat approach of putting as much stuff in /home as possible makes a fair bit of sense, ultimately: it makes migration much, much easier to upgrade and migrate to newer hardware (or, for that matter, a different OS entirely).

re: FreeBSD: The best server OS.

re: FreeBSD: The best server OS.

may I have an url for tutorial installation and configuration FreeBSD for server ?thank you

re: FreeBSD: The best server OS.

FreeBSD has always been OS of my choice. At work I use Linux ( just because of requirement ) but at home I've two PCs running FreeBSD 7. Utilities like portsnap, portaudit and portupgrade works as magic :) . Very easy to update OS kernel and packages as well.Simply ..FreeBSD rocks !

re: FreeBSD: The best server OS.

I agree with a lot of the statements in the article, I've been using FreeBSD for quite a while now and it's fantastic.An important point noted is that FreeBSD is disciplined which keeps my sanity in tact.The drawback/headache I find with Linux distros is that there doesn't seem to be any discipline - files are located in different parts of the file system depending on which distro and even which release you're working on.Hop on almost any FreeBSD machine and you'll feel at home, know where the config files are and how to install/modify your apps.Not a lot of bells and whistles, but it gets the job done and is super stable.

re: FreeBSD: The best server OS.

Excellent article! I too would like to hear more of the rest of your choices for using FreeBSD.For me, I find that the biggest drawback of FreeBSD is the monolithic distribution "core" (which is updated via "make world"). In all of the Linux (and UNIX) package-based distributions I know of, the entire system is wrapped in the packages. BSD is not so.This means that upgrading anything in the base system is a pain and may tend to get put off more than others. It also means that the base is untouched - unstripped - not slimmable. If its in the core and you don't want it, you get it anyway.If you "upgrade" to a newer version of whatever via ports, the base system is untouched. Now you have two versions - which is running?As much as I've gone into this, I love FreeBSD. It is unfortunate that companies like Oracle don't certify their products on FreeBSD.

re: FreeBSD: The best server OS.

Dear Robert,I've found your arguments quite interesting. My experiences are with the management of Debian GNU/Linux and FreeBSD servers (home and small businesses).Pros for FreeBSD : excellent documentation, impressive stability, lean but complete inital setup, i LOVE rc.conf.Pros for Debian : packages choice, OS upgrades are so smooth with aptitude, OS virtualization with linux-vserver/open-vz is clearly easier to manage than BSD jails.Pros for both environments : gcc support, easy initial installation, robust default filesystem (UFS2 or EXT3), easy installation of packages, easy application of security updates (for default kernels).My conclusion : FreeBSD and Debian/Linux are really fine OS and, for my part, I found it more and more difficult to choose between them. We are blessed to have free access to these OS and their respective communities!

re: FreeBSD: The best server OS.

I would like to mention here a great distro not because you forgot to mention it but because it deserves more credit. It's called Arch Linux http://www.archlinux.orgThank you

re: FreeBSD: The best server OS.

anomie: While I don't use jails, I forget to list these things because I tend to take some of these features for granted. Thank you for listing them.

re: FreeBSD: The best server OS.

The one thing I did not see is any actual comparison to other servers and why FreeBSD met your needs better than the others.FWIW, here is a short list of FBSD features that I find invaluable. Each is already available as part of a default installation.

  • FreeBSD Jails (easy to maintain/update many different servers on one box; low overhead). This feature alone keeps me with FBSD. I don't have to install virtualization software or heavily modify a kernel for this to work, either.
  • Ability to upgrade base system easily, remotely, from the command line. Tried, tested, and true.
  • Valuable facilities to secure various types of installations through securelevels (which allows you to truly make files immutable - even to root - among other things).
  • Fantastic documentation: the manpages are readable, up-to-date, and useful. The handbook is maintained and provides useful guidance for a large range of issues.
  • Flexible software management - ports. You set up options at compile time. When ports break, it's almost invariably a case of PEBKAC.

re: FreeBSD: The best server OS.

So, If I compile some user land software, it's binaries go in /usr/local/bin. If I install user land software from the distribution repositories, it should be in /usr/bin.No. Ports are installed to /usr/local.Distribution repositories? This is FreeBSD, not Ubuntu.

re: FreeBSD: The best server OS.

I found your comments to be nicely stated in terms of what FreeBSD can do and why you consider it to be the best server operating system for your specific needs. The one thing I did not see is any actual comparison to other servers and why FreeBSD met your needs better than the others.For completeness, I would be interested in seeing that information.Other than that, this still comes down to a matter of preference. For you, FreeBSD works better than the others. No doubt FreeBSD is an excellent server operating system. Other people may take issue and say they like some other server operating system.I do not think either is necessarily right or wrong. What I think is important is to discuss under what circumstances a particular system is especially appropriate for certain tasks.It would be nice if you could discuss that. If not, this was still interesting. Without further information, that's where this falls, in the category of "interesting". Any additional comparisons which highlight what FreeBSD does versus what other systems do would be helpful.Thanks again for your interesting article.Brian

re: FreeBSD: The best server OS.

I think you are confusing "Userland" with "User-Installed." Userland simply means 'not provided or required by the core system.' Both applications installed in /usr and /usr/home are userland, but ones in /usr are shared for all users to run (installed by the administrator) vs installed by a user and only intended for that user to run.

re: FreeBSD: The best server OS.

Yes, however Windows itself does not use the same messaging paradigm (pipes) that UNIX uses which you will typically see broken down into small functions (grep, awk, sed, cut, sort, uniq, etc...) which allow for simple chaining of commands for complex data manipulation without adding any additional software. That's the UNIX way. You can always build cygwin and run unix utils in Windows but it's not quite the same.

re: FreeBSD: The best server OS.

Your comments on /usr/local/bin do not make a lot of sense. /usr/local/bin is for packages installed by the admin, that are not part of the distribution. So, If I compile some user land software, it's binaries go in /usr/local/bin. If I install user land software from the distribution repositories, it should be in /usr/bin.

re: FreeBSD: The best server OS.

One of my serious server OS requirements is that the OS allows for extensibility, that is, adding functionality easily where it didn't previously exist, which, through Windows, is virtually impossible without purchasing additional software. UNIX-based operating systems are fundamentally extensible.Although I agree that Unix makes a better server than Windows (although I much prefer Linux to FreeBSD myself), I have to disagree with this particular point. Most open source tools run on Windows too, these days, and most Unix systems have their own share of commercial proprietary applications.