What Real Web Servers Do

5.3 What Real Web Servers Do

The Perl server we showed in Example 5-1 is a trivial example web server. State-of-the-art commercial web servers are much more complicated, but they do perform several common tasks, as shown in Figure 5-3:

Figure 5-3. Steps of a basic web server request

figs/http_0503.gif

1.             Set up connectionaccept a client connection, or close if the client is unwanted.

2.             Receive requestread an HTTP request message from the network.

3.             Process requestinterpret the request message and take action.

4.             Access resourceaccess the resource specified in the message.

5.             Construct responsecreate the HTTP response message with the right headers.

6.             Send responsesend the response back to the client.

7.             Log transactionplace notes about the completed transaction in a log file.

The next seven sections highlight how web servers perform these basic tasks.

 



HTTP. The Definitive Guide
HTTP: The Definitive Guide
ISBN: 1565925092
EAN: 2147483647
Year: 2001
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net