Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
562 PART IV Application Level HTTP IN ACTION Web browsers and Web servers are perhaps even more familiar than electronic mail, but nevertheless there are some interesting things that can be explored with HTTP on the Illustrated Network. In this chapter,Windows hosts will be used to maximum effect. Not that the Linux and FreeBSD hosts could not run GUI browsers, but the "purity" of Unix is in the command line (not the GUI). We'll use the popular Apache Web server software and install it on bsdserver . Just to make it interesting (and to prepare for the next chapter), we'll install Apache with the Secure Sockets Layer (SSL) module, which we'll look at in more detail in the next chapter. We'll also be using winsrv1 and the two Windows clients, wincli1 and wincli2 , as shown in Figure 22.1. We could install Apache for Windows XP as well, because one of the goals of this book is to explore how much can be done with basic Windows XP Professional. But we don't want to go into full-blown server operating systems and build a complete Windows server. It should be noted that many Unix hosts are used exclusively as Web sites or email servers, but here we're only exploring the basics of the protocols and applications, not their ability or relative performance. The Web has changed a lot since the early days of statically defined content deliv- ered with HTTP. Now it's common for the Web page displayed to be built on fly on the server, based on the user's request. There are many ways to do this, from good old Perl to Java and beyond, all favored and pushed by one vendor or platform group or another. In Windows, the "in-house" dynamic Web page software is called Active Service Pages (ASP). ASP works differently than the others, but all of them vary in large or small ways, so that's not really a criticism. So, we'll install Integrated Information Services (IIS), available for Windows XP Pro and a few other (free) packages, notably the .NET Framework and Software Develop- ment Kit (SDK). This will make it possible for us to build ASP Web pages on winsrv1 and access them with a browser. The ASP installation was rather torturous, but there are invaluable Web sites and books that take you through the process step by step. One book includes an extremely simple Web page along the lines of "Hello World!" (but the Web page is also small enough to demonstrate how HTTP fetches the page). Figure 22.2 shows how the page looks in the browser window on wincli2 . What does the HTTP exchange look like between the client and server? Let's cap- ture it with Ethereal and see what we come up with. Figure 22.3 shows the result. Not surprisingly, after the TCP handshake the content is transferred with a single HTTP request and response pair. The entire page fit in one packet, which is detailed in the figure. And just as it should, once TCP acknowledges the transfer the connection stays open (persistent). Note that the dynamic date and time content is transferred as a static string of text. All of the magic of dynamic content takes place on the server's "back room" and does not involve HTTP in the least.