Page 235 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 235
Unit 12: Server Role: Linux as Web Server
! notes
Caution If you don’t have GCC then at least make sure your vendor’s compiler is ANSI
compliant.
customizing apache for windows
Apache is configured by the files in the conf subdirectory. These are the same files make use to
configure the Unix version, but there are a few different directives for Apache on Windows. See
the directive index for all the available directives.
The main differences in Apache for Windows are:
1. Because Apache for Windows is multithreaded, it does not use a separate process for each
request, as Apache does on Unix. Instead there are generally only two Apache processes
running: a parent process, and a child which handles the requests. Within the child process
each request is handled by a separate thread.
The process management directives are also different:
(a) MaxRequestsPerChild: Like the Unix directive, this manage that how many requests
a single child process will serve before exiting. However, unlike on Unix, a single
process serves all the requests at once, not just one. If this is set, it is recommended
that a very high number is used. The recommended default, MaxRequestsPerChild
0, causes the child process to never exit.
(b) ThreadsPerChild: This directive is new. It informs the server how many threads it
should use. This is the maximum number of connections the server can handle at
once, so be sure to set this number high enough for your site if you get a lot of hits.
The recommended default is ThreadsPerChild 50.
2. The directives that admit filenames as arguments 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.
3. While filenames are usually case-insensitive on Windows, URLs are still treated internally
as case-sensitive before they are mapped to the filesystem. For example, the <Location>,
Alias, and ProxyPass directives all use case-sensitive arguments. For this reason, it is
particularly important to use the <Directory> directive when attempting to limit access to
content in the filesystem, since this directive applies to any content in a directory, regardless
of how it is accessed. If you wish to assure that only lowercase is used in URLs, you can use
something like:
RewriteEngine On
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lowercase:$1} [R,L]
4. Apache for Windows contains the capability to load modules at runtime, without
recompiling the server. If Apache is compiled normally, it will install a number of optional
modules in the \Apache2\modules directory. To activate these or other modules, the new
LoadModule directive must be used. For example, to activate the status module, use the
following (in addition to the status-activating directives in access.conf):
LoadModule status_module modules/mod_status.so
Information on creating loadable modules is also available.
LoveLy professionaL university 229