Windows Installation
The Windows installation process is almost completely automated. The binary distribution available from www.apache.org is self-installing (see Figure 1-2).4 Just double-click on the downloaded file. You will be asked to agree to some licensing information and choose a directory in which Apache will be installed.
Figure 1-2 Windows binary distribution
Before you start, you should be aware that on Windows NT and 2000, you have the option of running Apache as a Windows service as opposed to a normal executable. This is by far the preferred method. Unlike normal executables, Windows services may be started automatically when the system is booted and continue to run even after the user who started them has logged off. These features have obvious advantages for Web servers, which presumably should be available on a 24/7 basis.
Basic Installation
The default directory for Windows installations is C:\Program Files\Apache Group\Apache. If you plan on running Apache as a Windows service, you should change this to C:\Apache. If not, the default location is fine.
Other than selecting a root directory for the executables and deciding whether or not you want the source code, the installation proceeds more or less automatically. Click the Finish button and you're done.
Installing as Windows Service
To install Apache as a Windows service, you may select the "Install Apache as Service" option from the Apache folder under the Start menu. Alternatively, type the following from the command line:
apache -i
This installs the Apache executable as a service named Apache. With versions of NT later than 1.3.7, you may specify different names for the service. Also, NT allows you to specify a configuration file for use during the configuration:
apache -i -n "httpd" -f "\\Odin\Apache\conf\httpd.conf"
This installs a service named httpd with a configuration specified by the UNC designator "\\Odin\Apache\conf\ httpd.conf".
If you're on Windows NT or 2000, running Apache as a service is the preferred method. The services utility is accessed via Start->Settings->Control Panel->Services (see Figure 1-3).
Figure 1-3 Windows services
From this window, you can stop and restart the Apache service. By highlighting it and clicking the Startup button, you can bring up a service window in which you choose when Apache is started. There are three options:
Automatic |
Apache will be invoked automatically at boot time. |
Manual |
Apache must be stopped and started by hand. |
Disabled |
Halts a running instance of Apache. |