29.3. Connecting to a Web server

To connect to a Web server you use a Uniform Resource Locator (URL). The URL contains two pieces of information:

The protocol The address and data 

The protocol can consist of http, ftp, mailto, file, telnet and news. We will only be concerned with http, which stands for hypertext transfer protocol.

The address is usually the DNS name or hostname of the server, but can be the IP address. Other data can also be the actual pathname to the file that you wish to access.

All connections are carried out using the TCP protocol, which defaults to port 80 on your machine.

If you have a Web server set up on your local host, with a main HTML page called index.html, then you would type:

http://localhost/index.html 

Generally ...

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.