Although 80 and 443 are system ports, how are most web servers able to bind to them anyway

permissionsport-443service

Running a web-service that binds to port 80 usually doesn't require sudoer privileges.
Since ports 80/443 are system ports, meaning they can only be used by privileged users, how come those services are still able to bind to these ports?

Best Answer

There are basically two different approaches:

  1. Initially start running as root, bind to the privileged port, and then drop down to an unprivileged user.

  2. inetd, or xinetd runs privileged, and forwards the requests to web server running unprivileged.