Fix the Pow can't start in OSX Yosemite (10.10)

Pow is a zero-configuration Rack server for Mac OS X. It makes developing Rails and Rack applications as frictionless as possible. Unfortunately, Yosemite breaks pow because ipfw has been completely removed from the OS. I was able to get pow working again using PF, which is the new recommended way to do port forwarding in OS X. Here's what I did to get it working:

  1. First, add an anchor file to contain the pow port forwarding rule. Place the following code in /etc/pf.anchors/com.pow: (Note: edit these files require root privileges)
rdr pass on lo0 inet proto tcp from any to any port 80 -> port 20559

NOTE: The trailing line break is required. Otherwise pf will say you have a syntax error.

  • Next, add two lines to /etc/pf.conf to load your new rule. It is important where these lines go. Add this line right after rdr-anchor "*" :
rdr-anchor "pow"
  • Also in /etc/pf.conf, Add this line directly after load anchor "" from "/etc/pf.anchors/" :
load anchor "pow" from "/etc/pf.anchors/com.pow"

Again, make sure to maintain the final line break.

  • Next, reload the rules into pf by running sudo pfctl -f /etc/pf.conf

  • Finally, enable pf by running sudo pfctl -e