|
Web Hosting Articles
|
Apache for Windows: A Beginner's Guide
Apache, one of the more popular web servers, is freely available for all those with a computer system and an interest in server administration. Although it was originally designed for UNIX, Apache can be ported to Windows, and here is how.
Getting started: Apache, a web server?
This portion takes a look at what a web server is and how Apache interacts and serves pages. If you are already familiar with basic web server concepts, feel free to jump ahead to our next section, "Download and Installation".
Apache is a web server. A web server is software that, yes, serves the web. All web servers, by default, 'listen' to port 80. A port, as defined by Webopedia, is defined as "... an endpoint to a logical connection. The port number identifies what type of port it is. For example, port 80 is used for HTTP traffic." Although there are hundreds of ports available, only some are monitored by software.
When a request comes into a computer system on port 80, the web server, if one exists, reads that request and fulfills its obligation to the client (the requesting machine). For example, if a client requests 123.html, then the web server will fetch that page and send it back to the client (usually their browser). If no web server is present, or if it is not turned on, then the requesting machine will receive an error. For example: http://www.thisisabsolutelynodomain.com/. Since no web server runs on that domain, we receive a DNS error.
Apache was designed and is maintained by a group of volunteer programmers. They receive no money for their work, regardless of how successful the web server is. Apache, therefore, is known as open-source software, in that the code is not protected and there is no fee for use.
Apache comes with support for around 150 directives, also known as features or add ons. These directives are controlled by a configuration file which is distributed with the web server. In an upcoming article, we will look at the configuration file and examine its contents.
Download and installation
Download and installation of the Apache web server on a Windows platform is actually very easy. The main Apache HTTP server web site is located at http://httpd.apache.org/. On that page you can find documentation and information about server issues and the latest version of Apache.
You will notice the release of Apache 2.0. However, we will not be working with that release. Instead, we will concentrate on Apache 1.3.27. Let's jump to the download page for Apache for Windows:
http://www.apache.org/dist/httpd/binaries/win32/
If you have Microsoft Installer software, which most do, go ahead and download "apache_1.3.27-win32-x86-src.msi". At the time of this writing, it was the 8th listing down the list, including the TROUBLESHOOTING.html document. If not, go ahead and download the first listing, or "apache_1.3.27-win32-x86-no_src.exe".
After downloading the either document, go ahead and run the program. It will install the web server for you automatically and start the server. As the installation progresses, you should be asked whether or not to run Apache 'as a service'. Running as a service means the web server will start each time you boot your computer up. I strongly recommend you run Apache as a service. All other options you may leave as default.
If the installation went correctly, your web server should already be up and running. To test whether or not your installation is running, open a web browser and navigate to localhost, or http://localhost/. Obviously, do not include the period after the last forward slash. The URL localhost tells the browser to look on the local host machine on port 80 for a web server.
If it installed correctly and is running, you will see a test Apache page at the localhost URL. The first paragraph will say "If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page."
If you see that, then congratulations, you are up and running! If you do not see the test page, then we need to make sure that the server is running. Click your Start menu, and then click Programs. From the list, you should see an Apache HTTP Server listing. Click it and then select the Control Apache Server menu listing and click on Start. After clicking on Start, you may quickly see a DOS window flash on your screen. That means that Apache has attempted to start your server through a DOS prompt window.
At this point, your web server should be running, but that does not necessarily mean that the test Apache page is visible. Any Windows NT/2000 and later users may have IIS (Internet Information Server) installed and running. Because all web servers run on port 80, this presents a little problem. What you will need to do is either turn your other web server off (IIS) or instruct it to listen on another port.
If you are running IIS, here is a simple procedure for changing the default port. Click your Start menu, then on Settings and Control Panel. From there, select Administrative Tools and double-click Internet Services Manager. Double-click your computer's name in the right pane to list all servers (FTP, Web and SMTP). From here, you can either turn the server off by selecting Default Web Site, then click the Stop button (little box at the top) or change the port. To change the port, right-click on Default Web Site and select Properties. Then, under TCP Port, type in another number (usually 88 or 8080). Afterwards, click OK.
Hopefully everything should be running successfully on localhost. You are seeing the default index.html file distributed on all Apache installations. To change this page to something different, we will navigate to the default web site directory on the hard drive. If you installed with default settings, then your default directory should be:
c:\Program Files\Apache Group\Apache\htdocs
To change the default index.html file (or the default page you see in your browser), simply create one of your own and place the file within the htdocs directory (be sure to save the file as index.html). Then, return to your browser and reload your localhost URL. If you do not see your changes, be sure that you placed your index.html file within the correct directory.
You are effectively done. You may now place all your web site content within the htdocs directory and even create new directories within htdocs.
In a future article, we will dig a little deeper within the Apache web server and examine the configuration files.
|
|