How To Set Up PF Firewall on FreeBSD to Protect a Web Server

Originally published at:

I am a new FreeBSD server user and moved from netfilter on Linux. How do I setup a firewall with PF on FreeBSD server to protect a web server with single public IP address and interface?