Saturday, April 27, 2013

FreeBSD: The best server OS.

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.

No comments:

Post a Comment