Differences between FreeBSD and Debian, two weeks in

I’m evaluating if FreeBSD can take the place of Debian on my production servers. Over the past month I’ve read several books, scoured forums and the FreeBSD handbook, and taken ample notes along the way.

But no amount of reading can prepare you for what happens when you get your hands dirty. Here are some of the head-scratchers I’ve encountered along my journey.

What’s different?

  • Apache and Nginx are set up much differently — the sites-available and sites-enabled directories are missing!

    Turns out the addition of those directories is something added by Debian, that’s not really how the upstream versions of those web browsers are shipped.

    At first I was disappointed, then I realized the Debian way is much more complicated than I need. Why use commands like a2ensite and manage all those different directories and all those symlinks when you can simply make some .conf files and manage them yourself with simple commands you already know?

  • Accessing MariaDB locally isn’t always possible via localhost. Sometimes you have to use 127.0.0.1:3306 or localhost:/var/run/mysql/mysql.sock so PHP can connect to the database.

  • The FreeBSD handbook provides great advice to use ssmtp for routing simple outgoing console/cron emails to yourself instead of setting up big, bulky, cranky postfix.

  • Bash script opening shebangs need to be changed to #!/usr/bin/env bash to make them platform agnostic (they won’t run on FreeBSD if they are #!/bin/bash).

  • There doesn’t appear to be a binary package for Ruby Gems, so to get Jekyll to work I had to install the ports system and build devel/ruby-gems. Not a big deal, but I was able to use binary packages for everything else.

Packages with different names

  • vim-console (vim is the GUI version and wants to install 343 MB of stuff, including Wayland!)
  • p5-ack (instead of ack-grep, this one took a while to find)

Thoughts: Two weeks in

The switch to FreeBSD has been a learning experience. It wasn’t easy, but it also wasn’t impossible. Looking back at my first two weeks it feels like I’m able to do all the things I want, I just had to contend with knowledge gaps and what feel like dead ends in documentation. Things like what I’ve listed above take time to figure out. Patience and persistence are definitely required.

It’s tough to un-learn concepts I know from Debian, like that Apache/Nginx come with sites-available and sites-enabled directories. Google searches for freebsd apache sites-available don’t return anything helpful, because the concept of those directories doesn’t exist in FreeBSD. None of this made sense until I stumbled across a forum post where someone said, “Apache doesn’t have sites-available, that’s a Debian-specific addition.” That was eye-opening.

"You must unlearn what you have learned."

This un-learning process is the toughest part of this journey. I’m so used to how to do things in Debian and Linux that it’s tough to put all of that knowledge aside and see around it. My past knowledge can actually derail my efforts to find solutions in the FreeBSD world. I’m too busy looking for "the thing I know in Linux," which doesn’t always exist in FreeBSD.