When we want to publish web pages on the Internet (or on an intranet), we use a web server. In essence, a web server is an application that does two things:
• It listens for page requests.
• When it receives a page request, it examines the request and responds with the page that was requested.
For example, when you use a web browser to browse http://www.wrox.com, the browser turns this into a request message and sends it across the Internet to Wrox's own web server. When the web server receives this request, it processes it, works out what page you requested, puts that page together from whatever resources are necessary, and sends the page back to your browser, in the form of a response message.
Of course, there are many different web browsers in existence (including Mozilla, Opera, Internet Explorer, and others), and there are also a great many types of web server software. To enable a browser to request pages from a web server, they communicate using Hypertext Transfer Protocol (HTTP) - this is the standard protocol for the Internet. The request and response messages are composed using HTTP, and this is what allows any browser to request web pages from any type of web server.
Note By default, all web servers listen for HTTP requests on port 80. Web servers also use port 443 to listen for requests made through secure HTTP connections, over SSL (secure sockets layer), through a protocol called HTTPS.
So, if you want to publish your own web site, you'll need a machine with some web server software. However, the chances are that if you build your own web site, you probably won't want to expose it to the Internet from your own machine. There are security and maintenance issues to manage, and you'd need to buy enough hardware and bandwidth to handle all the page requests. More likely, you'd choose an Internet service provider (ISP), and use their web servers to host your web site for you.
So, why would you want to install a web server on your Red Hat Linux machine? Well, here are two scenarios:
• First, if you're building a web site, then you'll need a web server so that you can test your site as you're developing it
• Second, although you might not host an Internet site from your own machine, you might host an intranet site - a private web site available only to other machines inside your private network. The demand for intranet pages is much more predictable than for Internet pages, and the security risks are not so significant.
So, in this section, we'll show you how to set up a web server on your machine, configure it, and publish pages on it. From there, you'll soon be developing your own sites.
Was this article helpful?