Greg's Blog

helping me remember what I figure out

Installing the Apache Web Server on Windows 2000 With IIS 5 Running

| Comments

Installing the Apache web server on Windows 2000 with IIS 5 running

This document explains how I configured the Apache web server to run on my Windows 2000 machine with IIS 5 running simultaneously. The extraction of the files and there installation is extremely straightforward. Simply double click on the executable file and follow the prompts (as a rule accept the defaults that the installation supplies). Once this is done you can click on the Start button and from Programs, choose the Apache Web Server folder and choose the Install Apache as a service. This again is done automatically and all you should see is a DOS prompt that flashes up quickly and close once the process is completed. Now you are able to start the server as a service.

This however is also the stage during which you will run into problems if you are running IIS5 on your box. If you tried to fire up the server from the Start Apache option in the Apache Web Server folder, another DOS window will open quickly and close down. Trying to browse a file will produce no results. If you have installed the option to run Apache as a service and try and start it you’ll see a dialogue popup informing you that the service has failed to start. By going to the command prompt and typing apache you’ll get an error message. This should give you a hint as to why the server is failing to startup. In order for the installation to work side by side you need to configure certain options.

All of the Apache server configuration is done with the help of conf files. These are basically text files that the server reads at startup to set the options for your server. The files are located in the conf directory of your installation path (if you choose the defaults that will be c:Program FilesApache GroupApacheconf).

The only file you’ll need to edit is the httpd.conf file. Please note that you really should make a backup copy of the original file, just in case. This file controls the startup parameters of the Apache web server daemon (or service). You will need to make to adjustments, you will need to specify the Server Name and the default port the server will listen on.

First off locate the line that specifies the port the server listens on:

#
# Port: The port to which the standalone server listens.
#
Port 80

By default this is set to port 80, but your IIS server is listening on that port. So change the setting to 8081 (you can specify any value that you like as long as it doesn’t belong to another service that is running [e.g.: port 25 belongs to SMTP]). That section will look something like this (depending on the port you have chosen):

#
# Port: The port to which the standalone server listens.
#
Port 8081

So far so good, now we need to specify the server name, so locate the following line:

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it’s different than the one the program would get (i.e., use
# “www” instead of the host’s real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don’t understand
# this, ask your network administrator.
# If your host doesn’t have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
#ServerName new.host.name

By default this section is commented out so you’ll need to un-comment the line. You do this by removing the hash in front of the line with ServerName. Next you’ll need to specify a host name. After ServerName specify your server name, e.g. localhost. So now that section should look something like this:

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it’s different than the one the program would get (i.e., use
# “www” instead of the host’s real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don’t understand
# this, ask your network administrator.
# If your host doesn’t have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
ServerName localhost

Right that’s it. The server is ready to be fired up. From the command line in the c:Program FilesApache GroupApache directory type apache. This will startup the server. If all is working you’ll see the following content in the DOS window:

[Thu Jun 22 23:16:49 2000]
Apache/1.3.12 (Win32) running?

Should there be any errors these will appear in the window with hints on how to remedy them. Shortly I will explain how to configure Perl to work for Apache.