|
You can see from this description that a Web
server can be a pretty simple piece
of software. It takes the file name sent in with the GET command, retrieves
that file and sends it down the wire to the browser. Even if you take into
account all of the code to handle the ports and port connections, you could
easily create a C program that implements a simple Web server in less than
500 lines of code. Obviously, a full-blown enterprise-level Web server is more
involved, but the basics are very simple.
Most servers add some level of security to
the serving process. For example, if you have ever gone to
a Web page and had the browser pop up a dialog box asking
for your name and password, you have encountered a password-protected
page. The server lets the owner of the page maintain a list
of names and passwords for those people who are allowed to
access the page; the server lets only those people who know
the proper password see the page. More advanced servers add
further security to allow an encrypted connection between
server and browser, so that sensitive information like credit
card numbers can be sent on the Internet.
That's really all there is to a
Web server that delivers standard, static pages. Static pages
are those that do not change unless the creator edits the
page.
But what about the Web pages that
are dynamic? For example:
- Any guest book allows you to
enter a message in an HTML form, and the next time the
guest book is viewed, the page will contain the new entry.
- The
whois form at VeriSign allows you to enter a domain
name on a form, and the page returned is different depending
on the domain name entered.
- Any search engine lets you enter
keywords on an HTML form, and then it dynamically creates
a page based on the keywords you enter.
In all of these cases, the Web server is not
simply "looking
up a file." It is actually processing information and generating
a page based on the specifics of the query. In almost all cases,
the Web server is using something called CGI
scripts to accomplish this feat. CGI scripts are a
topic in themselves, and are described in Stage 8. |