Once the hostname is known, the web server routes the request to the matching virtual-host block (vhost) and serves the correct files, runs the right application, applies the right access rules, and writes to the right log—all while the underlying CPU, RAM, and network stack are shared among all sites on the box.