Page 57 - Open Soource Technologies 304.indd
P. 57
Open Source Technologies
Notes TCP/IP ports. You may find the Windows “netstat -an” command useful in finding out what
ports are in use.
Configuring Apache for Windows
Apache is configured by files in the conf directory. These are the same as files used to configure the
Unix version, but there are a few different directives for Apache on Windows Begin configuring
the Apache server by reviewing httpd.conf and its directives. Although the files access.conf and
srm.conf both exist, these are old files which are no longer used by most administrators, and
you will find no directives there.
httpd.conf contains a great deal of documentation itself, followed by the default configuration
directives recommended when starting with the Apache server. Begin by reading these comments
to understand the configuration file and make small changes, starting Apache in a console
window with each change. If you make a mistake, it will be easier to back up to configuration
that last worked. You will have a better idea of which change caused the server to fail.
The main differences in Apache for Windows are:
• Because Apache for Windows is multithreaded, it does not use a separate process for each
request, as Apache does with Unix. Instead there are usually only two Apache processes
running: a parent process, and a child which handles the requests. Within the child each
request is handled by a separate thread. So, “process”-management directives are different:
— MaxRequestsPerChild - Like the Unix directive, this controls how many requests
a process will serve before exiting. However, unlike Unix, a process serves all the
requests at once, not just one, so if this is set, it is recommended that a very high
number is used. The recommended default, MaxRequestsPerChild 0, does not cause
the process to ever exit.
— ThreadsPerChild - This directive is new, and tells the server how many threads it
should use. This is the maximum number of connections the server can handle at
once; be sure and set this number high enough for your site if you get a lot of hits.
The recommended default is ThreadsPerChild 50.
• The directives that accept filenames as arguments now must use Windows filenames
instead of Unix ones. However, because Apache uses Unix-style names internally, you
must use forward slashes, not backslashes. Drive letters can be used; if omitted, the drive
with the Apache executable will be assumed.
• Apache for Windows has the ability to load modules at runtime, without recompiling the
server. If Apache is compiled normally, it will install a number of optional modules in
the modules directory. To activate these or other modules, the new LoadModule directive
must be used.
• LoadModule status_module modules/mod_status.so.
• Apache can also load ISAPI Extensions (i.e. Internet Server Applications), such as those
used by Microsoft’s IIS, and other Windows servers.
52 LOVELY PROFESSIONAL UNIVERSITY