★ wanayoo — archive 1999 http://www.howstuffworks.com/web-server4.htmNouvelle recherche | Portail wanayoo

How Stuff Works



How Web Servers and the Internet Work
by Marshall Brain

Sponsored by
webhosting.com

At webhosting.com we love How Stuff Works, and that is why we support the site. HSW provides great information in an easy-to-understand format. If you are reading this page and looking for a company that can host the site you are developing, we hope you will come visit webhosting.com and look at the services we have to offer. We host over 30,000 sites in 130 countries, and we would love to host yours!


Related Articles!
If you are interested in web servers you may also be interested in the other articles in the How Stuff Works Internet Category. You can Click Here to see a complete list of articles in the category!

[This article is part of a series called How Web Servers Work. It will make no sense unless you have read the beginning of the series. For an introduction to the series, please click here.]

Putting It All Together
Now you know a tremendous amount about the Internet. To summarize, when you type a URL into a browser the following steps occur:

How a Web Server Works
You can see from this description that a web server can be a pretty simple piece of software. It simply takes the file name passed in with the GET command, retrieves that file and sends it down the wire to the browser. Even if you take all of the code to handle the ports and port connections into account, you could easily create a C program that implements a simple web server in less that 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 asking for your name and password, you have encountered a password-protected page. The server lets the owner of the server maintain a list of names and passwords for people who are allowed to access the page, and the server lets only those people who know the proper password to see the page. More advanced servers add security to allow an encrypted connection between server and browser so that sensitive information like credit card numbers can be sent on the Internet.

At a high level, that's really all there is to a web server that delivers standard "static" pages. "Static" means that the page does not change unless the creator edits the page.

But what about all of the web pages that are "dynamic"? For example:

In all of these cases, the web server in not simply "looking up a file". It is actually processing information and generating a page based on the query. In almost all cases, the web server is using something called CGI scripts to accomplish this magic. CGI scripts are a topic unto themselves and are described in the HSW article entitled How CGI Scripts Work.


If you are thinking about creating a web site and are looking for a company that can reserve your domain name or host your site, please click here. See also Question 222 for information on the entire process!


How Stuff Works Power Panel
Table of Contents
A complete list of all HSW articles

About Marshall Brain
Information about the creator of HSW

Search
Search for any word or concept in HSW

Citing HSW
Information about citing HSW in articles and papers

Question of the Day
Ask questions or browse hundreds in the archive

Books
A variety of books for people interested in how stuff works

HSW Newsletter
Sign up to receive the monthly HSW newsletter

Contacting HSW
Contact HSW directly with email

What's New
Review newsletters to chart HSW's development

Awards
Check out HSW's awards and reviews!

Disclaimer
The disclaimer required by the lawyer

Author Information
Learn how you can write for HSW

HSW Fan Buttons
Link to HSW with these snazzy fan buttons!
Suggestions
Leave a suggestion in the suggestion box


Howstuffworks.com, Inc. How Stuff Works (http://www.howstuffworks.com) is a production of
Howstuffworks.com, Inc.
P.O. Box 40492 - Raleigh, NC 27629
See http://www.howstuffworks.com/contact.htm for contact information

© 1999 Howstuffworks.com, Inc. All rights reserved.





Click Here!