Customization of Apache for Windows Apache
is configured using the files in the conf subdirectory. These are the same files used to configure the Unix version, but there are a few different directives for Apache on Windows. See the policy index for all available policies.
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 can on Unix. Instead, there are usually only two Apache processes running: a parent process and a child process that handles requests. Within the secondary process, each request is handled by a separate thread.
Process management policies are also different
:
MaxConnectionsPerChild: Like the Unix directive, this controls how many connections a single child process will serve before exiting. However, unlike Unix, a replacement process is not instantly available. Use the default value of MaxConnectionsPerChild 0, unless you are prompted to change the behavior to overcome a memory leak in third-party modules or in-process applications.
ThreadsPerChild: This directive is new. It tells the server how many threads to use. This is the maximum number of connections the server can handle at one time, so be sure to set this number high enough for your site if you get a lot of results. The recommended default is ThreadsPerChild 150, but it must be adjusted to reflect the highest anticipated number of concurrent connections to accept.
-
Policies that accept file names as arguments must use Windows file names instead of Unix. However, because Apache can interpret backslashes as an “escape character” sequence, you must use forward slashes in path names, not forward slashes.
-
in Windows, URLs are still treated internally as case-sensitive before they are mapped to the file system. For example, the <Location>, Alias, and ProxyPass directives use case-sensitive arguments. For this reason, it is particularly important to use the <Directory> policy when attempting to limit access to content in the file system, because this policy applies to any content in a directory, regardless of how it is accessed. If you want to make sure that only lowercase is used in URLs, you can use something like
: RewriteEngine in lowercase RewriteMap int:tolower RewriteCond “%{REQUEST_URI}” “[A-Z]” RewriteRule “(.*)” “${lowercase:$1}” [R,L]
-
When running, Apache needs write access only to the logs directory and any configured cache directory trees. Because of the problem of short, case-sensitive 8.3 format names, Apache must validate all given path names. This means that each directory that Apache evaluates, from the drive root to the directory blade, must have read, list, and traverse permissions through the directory. If Apache2.4 is installed in C:Program Files, the root directory, Program Files, and Apache2.4 must be visible to Apache.
-
Apache for Windows contains the ability to load modules at runtime, without recompiling the server. If Apache compiles normally, it will install a number of optional modules in the Apache2.4modules directory. To activate these or other modules, you must use the LoadModule directive. For example, to enable the status module, use the following (in addition to the health activation policies in access.conf):
LoadModule status_module “modules/mod_status.so”
Information on creating loadable modules is also available.
-
Apache can also load Internet Server Application Programming Interface (ISAPI) extensions like those used by Microsoft IIS and other Windows servers. More information is available. Note that Apache cannot load ISAPI filters and ISAPI drivers with some Microsoft feature extensions will not work.
-
When running CGI scripts, the method Apache uses to find the interpreter for the script can be configured using the ScriptInterpreterSource directive.
-
Because it is often difficult to manage files with names such as .htaccess in Windows, you may find it useful to rename this configuration file to directory by using the AccessFilename directive.
-
Any errors during Apache startup are logged in the Windows event log when running on Windows NT. This mechanism acts as a backup for those situations where Apache is not yet ready to use the file .log error. You can review the Windows application event log by using Event Viewer, for example, Start – Settings – Control Panel – Administrative Tools – Event Viewer.
While file names are generally not case sensitive