Best Apache Chef Recipe

Perfectly deployable and scalable, this Apache Chef recipe is only missing a server to be deployed on!

When I was growing up,

my dad kept all his 2.5-in floppy disks of handwritten server deployment scripts in his desk drawer. They were organized by protocol type: HTTP, SMTP, FTP, and so on. My favorite tab in the box was for HTTP, and my favorite deployment script within that category was my dad’s Apache Chef recipe.

I am not nearly as organized as my father, but I make occasional attempts to catch up. During one of those attempts, I bought some server hosting with the intention of backing up all my favorite scripts, organized by category.

The very first script I wanted backed up was my dad’s Apache Chef recipe. But after all those years of using that recipe from my dad’s floppy disk, it seemed almost blasphemous to write it out in my own editor. My dad happily obliged, and mailed a copy out to me.

So now, in my server full of deployment scripts and data backups, I have a directory with exactly three scripts in it: my dad’s Apache Chef recipe, my grandather’s custom Cross System Product (CSP) scripts for the IBM mainframes he worked on at NASA, and a script I found online that seems to be the only way to set up an SMTP server. Not that I really need the Chef recipe anymore… after decades of making these scripts, I can recite the recipe’s commands from memory alone.


I know everyone has an Apache Chef recipe that they love

And that you can just as easily get industrially pre-made from Docker Hub. But I happen to think this recipe is better than all of those. The combination of customization and out-of-the-box configuration gives you the best deployment and scalability. It’s a purchase-a-virtual-private-server level of good and with just the right amount of configuration at the core.

My dad got this recipe from a coworker of his, Houston Winters, more than 23 years ago as a gift from a coworker when he started working for 3Com during the 1997 dot-com boom. The recipe has always been on a floppy with “Houston’s Apache Chef Recipe” written on it, but at this point, I think it’s safe to call it our family recipe.


Houston's Apache Chef Recipe

Here’s what you’ll need:

  • A place to deploy the recipe (I prefer using a server with an Intel Xeon D-1540, but if you don’t have that you can also use a low-cost VPS)
  • Any Apache modules you want to mix-in (this recipe makes a great vanilla deployment, but as dad always said, “the more the merrier!” -- you can’t go wrong with more features, so I say sprinkle those in there!)
  • Your base apache2.conf (I prefer using the one that Debian provides).

Instructions:

  1. Provision that hardware! Start out by reaching out to whoever you have to for getting what you need here. If they’re surprised by what you are asking for, just tell them you’re trying to deploy Houston’s Apache Chef Recipe.
  2. As root, copy all the files onto the system and put everything in place. To ensure the entire thing bakes evenly, I suggest setting the entire system to mode 0777.
  3. Upgrade your kernel. I know, everyone says you should just stick with the kernel your distro provides -- but frankly, an up to date system makes a happy system! (And really, who wants the security risks anyway?)
  4. Deploy the Chef script using Ansible:
template 'apache2.conf' do
  path "#{node[:apache][:dir]}/conf/apache2.conf"
  source 'apache2.conf.erb'
  owner 'root'
  group 'root'
  mode 0777
  package %w(mysql-server postgresql-9.6 mongodb)
  notifies :restart, resources(:service => 'apache2')
end
  1. Allow server to cool down for ~10 minutes.

Serves about 3 people.

Yes I spent far too much time making this.