Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

How to Install the Apache Web Server on Windows
Set up and configure a local server to test your Perl/PHP Scripts and PagesHow to Install the Apache Web Server on Windows
by Christopher Heng, thesitewizard.com

Even though my "live" websites, like thesitewizard.com, are located on third party web hosts, I maintain an Apache web server on my Windows machine. Why?

I find it very inconvenient to have to go online just to test and debug my PHP scripts. If you write CGI and PHP scripts, you might be in the same boat.
Although I do have Apache and PHP installed in my Linux box, it is a real hassle to keep having to reboot in order to test my scripts, since I spend most of my time in Windows.
If you are facing a similar situation, or want to set up Apache in Windows for some other reason, you might find the information here useful.

Windows 95 Preliminaries
If you are using Windows 95 (whether the original release or OSR1, OSR2, 2.1 or 2.5), you will need to install Winsock 2 first. (Skip this section if you're using a later version of Windows).

Get both WS2SETUP.EXE (Winsock 2) and the Y2K fix for that (Y2KVDHCP.EXE) from the Windows 95 download page on Microsoft's website.

Go to the link for the Y2K fix for Winsock 2 and DUN 1.3 (or later) and follow it. It'll lead you to a page with both the fix as well as the complete Winsock 2 package.

Note that Winsock 2 requires you to have DCOM version 812 or higher installed. If you don't have that, download it (free of charge) from Microsoft and install it.

If, like me, you hate to install anything on your Windows machine that will affect the fragile balance it currently operates under, here are some (hopefully) reassuring news:

You do not have to install DUN 1.3 just to install Winsock 2. The two are separate. The Y2K fix listed above will not install any DUN 1.3 if you do not currently have it. (DUN 1.3 has been reported to cause problems on a number of Windows 95 machines.)
Winsock 2 can apparently be uninstalled, and your original Winsock 1.1 will be restored. Your old Winsock files are copied to C:\WINDOWS\WS2BAKUP together with a batch file named WS2BAKUP.BAT which can be used to restore your Winsock 1.1 if your upgrade fails for some reason.
Windows 95/98/ME Notes
If you are thinking of allowing others on the Internet to access your web server while it is running on Windows 95/98/ME, think again. The operating system is not secure, and opening your system to the world is asking for trouble.

If you really need to go "live", my suggestion is to install Linux into another partition (or disk) and read up on how to tightened your security and run your Apache server from there. Linux, by the way, is free. One way to obtain it is to download a set from RedHat.

Installing Apache
Precompiled executables, complete with a Setup program, of the Apache server are available from the Apache website.

Download and run it to get the server copied onto your machine.
During installation, a dialog box will appear asking you for your domain name and server name. Simply enter "localhost" for both. Enter whatever email address you wish for the email address field. The installer uses these values to create a default Apache configuration file for you.
If you later change your mind about the server name, you can always change it later with your favourite text editor (such as Notepad from your Start menu | Programs | Accessories | Notepad) by searching for and replacing the following line in the "C:\Program Files\Apache Group\Apache\conf\httpd.conf" file.
ServerName localhost
If you want your server to handle Server Side Includes (SSI), use a text editor (like Notepad) to open "C:\Program Files\Apache Group\Apache\conf\httpd.conf". Search for "server-parsed HTML files" in the file, and add the following lines (or uncomment the example lines in the configuration file by removing the prefixed hash marks, "#").
AddType text/html .shtml
AddHandler server-parsed .shtml

If you want "index.shtml" to be your default start page for your directories, ie, if you want Apache to load "index.shtml" when you type "localhost" or "localhost/directory/", you will need to search for a line in your "httpd.conf" that begins with "DirectoryIndex" and modify it as follows:
DirectoryIndex index.shtml index.html

Apache will now look for index.shtml first when it is given a directory without a file name, and only try index.html if index.shtml is missing.
Run the server with the "Start Apache" item in your Programs | Apache Web Server group that was created by the installer. A DOS console window will open and remain open as long as the server is running. When you want to terminate it, run "Stop Apache" from that same program group.
If you're using Internet Explorer 5 (and above), Opera or Mozilla (and presumably Netscape 6 and above which is based on Mozilla), you can test that you've properly installed and configured Apache by typing "localhost" or its IP address "127.0.0.1" into the location bar of the browser. You should see the default page installed by the Apache installer on your hard disk. It is located in "C:\Program Files\Apache Group\Apache\htdocs\". I have not been able to get earlier versions of IE and Netscape 4.73 to connect without the Dial-Up Networking dialog box popping up and insisting that I connect to my ISP (defeating the entire purpose of this exercise for me).
If you can't get your browser to connect to your local webserver, you can still test it by manually mimicking a browser. Go to the Start menu and select "Run". A dialog box will appear. Type "telnet localhost 80" (without the quotes) into the dialog box and click OK.
The Windows telnet program will start up. Go to the Terminal | Preferences dialog box and make sure that the "Local echo" check box is selected (unless you are one of those who like to type blind).
Type "get / http/1.0" (without the quotes) into the telnet window followed by hitting the Enter key twice. You will get a whole lot of text scrolling swiftly by. This is the default page installed by the Apache installer on your hard disk. If you can get this it means that you've successfully installed Apache.
Where to Go From Here?
The entire Apache manual set was installed on your machine in the "C:\Program Files\Apache Group\Apache\htdocs\manual\" subdirectory. Read it. This guide only covers installation. You (obviously) have to configure your server and learn where to put your documents and the like. If you'd like a hardcopy book on the Apache server, the one I used when I first started out was the O'Reilly book Apache The Definitive Guide. It's a bit weak on installation (which is why I wrote this), but it is helpful if you need to learn about configuring Apache and bone up on security issues.
If you need to install PHP support into your server, check out my article on How to Install and Configure PHP 4 to run with Apache on Windows.
If you wish to support Perl CGI scripts on your server, check out the article on How to Add Perl CGI Support to Your Apache Web Server on Windows.
Remember, this installation guide is designed for you to install Apache for private offline use. If your site is going "live", I suggest that you not only learn how to configure from the manuals but also brush up on security issues as well.

Copyright 2000-2002 by Christopher Heng. All rights reserved.
HOW TO MAKE YOUR SITE  ,CHOOSE YOUR DOMAIN AND  YOUR WEB HOSTING