CGI and Perl

The Connection

On the Internet, all communication takes place over a TCP/IP (Transport Control Protocol/Internet Protocol) connection. TCP/IP is the method or protocol used to transport data across the Internet. TCP/IP connections are established via a three-way handshake. The browser, or client, sends a connection request, the server responds, and then the client acknowledges the response.

The first step in an HTTP transaction begins when a client sends a connection request to the HTTP port on a server.

Port 80 is usually configured as the HTTP port on most Web servers. The Web server then responds to the connect request with a connect response. The client acknowledges the connect response and proceeds to send the first part of the request.


Though port 80 is typically used for a Web server (also known as an httpd), different ports can be used. The port number can be configured on a UNIX-based server in the
/etc/services file, or through Netscape's configuration server. You can actually have multiple Web servers, each using different ports, running on the same machine simultaneously. Browsers will always default to connecting to port 80, however. This behavior can be changed by adding a :portnumber to the end of the URI. For example:

will default to port 80, and thus is identical to

To connect to a Web server configured to run on port 81, you must explicitly specify the port number in the URI:

Sites that use Netscape server software typically are actually running two Web servers. One on port 80, which serves Web pages, and one on port 81, which serves as a configuration server. So, to configure a Netscape Web server, you actually connect to a separate Web server (HTTPD) running on a separate port.