What Does a Web Server Do?
The whole business of a web server is to translate a URL either into a filename, and then send that file back over the Internet, or into a program name, and then run that program and send its output back. That is the meat of what it does: all the rest is trimming.
When you fire up your browser and connect to the URL of someone’s home page — say the notional http://www.butterthlies.com/ we shall meet later on — you send a message across the Internet to the machine at that address. That machine, you hope, is up and running; its Internet connection is working; and it is ready to receive and act on your message.
URL stands for Uniform Resource Locator. A URL such as http://www.butterthlies.com/ comes in three parts:
<scheme>://<host>/<path>
So, in
our example, < scheme> is
http, meaning that the browser should use
HTTP (Hypertext
Transfer Protocol); <host> is
www.butterthlies.com ; and
<path> is /,
traditionally meaning the top page of the host.[1] The <host> may contain
either an IP address or a name, which the browser will then convert
to an IP address. Using HTTP 1.1, your browser might send the
following request to the computer at that IP address:
GET / HTTP/1.1 Host: www.butterthlies.com
The request arrives at
port 80 (the default HTTP port) on the host
www.butterthlies.com. The message is again in
four parts: a method (an HTTP method, not a URL method), that in this
case is GET, but could equally be
PUT, POST,
DELETE, or CONNECT; the Uniform Resource ...