How to Install
the Apache Web Server on Windows
By Christopher S L Heng |
Even though my "live"
websites 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.
Get both WS2SETUP.EXE (Winsock 2) and the Y2K fix for that (Y2KVDHCP.EXE)
from Microsoft's website.
http://www.microsoft.com/windows95/downloads/
Go to the link for the Y2K fix for Winsock 2 and DUN 1.3 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. DCOM can be obtained from:
http://www.microsoft.com/com/dcom/dcom95/dcom1_3.asp.
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:
1. 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.)
2. 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. Big 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 (which is possible
on Linux) and run your Apache server from there. Linux, by the
way, is free. You can always download a set from RedHat at:
http://www.redhat.com/.
Installing Apache
Precompiled executables, complete with a Setup program, of the
Apache server are available from the Apache website: http://www.apache.org/httpd.html
- Download and run it to get the server copied onto your
machine.
- Fire up your favourite text
editor and add the following line to
"C:\Program Files\Apache Group\Apache\conf\httpd.conf"
ServerName localhost
- 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.
- To test that it works, open a DOS console window and type:
telnet localhost 80
- 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 the following into the telnet window.
GET / HTTP/1.0
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 at your local site.
It is located in your
"C:\Program Files\Apache Group\Apache\htdocs\"
- If you're using Internet Explorer 5 or Opera, you might
be able to use it to connect to "locahost" or its IP address
"127.0.0.1" while offline. 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 the above to work, you can try downloading
a Windows console version of Lynx, a text based browser,
that seems to work fine.
http://lynx.isc.org/release/
http://www.jim.spath.com/lynx_win32/lynx_w32.zip
The command to access your local site is simply:
lynx localhost
You might as well get it anyway. It's a useful tool to check
your ordinary HTML pages for compatibility with this text
browser.
- If you plan to simply use telnet, I suggest that you get
a better one. The one I use is HyperTerminal Private Edition
(a more advanced version than the one distributed with Windows),
which is free. You can download it from: http://www.hilgraeve.com/htpe.html.
- Where to go from here? The entire Apache manual set was
installed on your machine in
"C:\Program Files\Apache Group\Apache\htdocs\manual\"
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 use is the O'Reilly book Apache
The Definitive Guide. It's a bit weak on the installation
bit (which is why I wrote this, after finding out how to
do it myself, the hard way), but it is helpful if you need
to learn about configuring Apache and bone up on security
issues.
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.
Source:
Copyright by Christopher S L Heng. All rights reserved.
Get more free tips and articles like this, on web design, promotion,
revenue and scripting, from http://www.thesitewizard.com/.
More Articles
|
.
|
[an error occurred while processing this directive]
|
|
|
|
|