windows.xml revision 0f7eda6275b7886c3db86dfa84961b2e06fa9c3a
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<?xml version="1.0" encoding="UTF-8" ?>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance<!-- $LastChangedRevision$ -->
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance Licensed to the Apache Software Foundation (ASF) under one or more
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu contributor license agreements. See the NOTICE file distributed with
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu this work for additional information regarding copyright ownership.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu The ASF licenses this file to You under the Apache License, Version 2.0
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu (the "License"); you may not use this file except in compliance with
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu the License. You may obtain a copy of the License at
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu http://www.apache.org/licenses/LICENSE-2.0
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Unless required by applicable law or agreed to in writing, software
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu distributed under the License is distributed on an "AS IS" BASIS,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu See the License for the specific language governing permissions and
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu limitations under the License.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<manualpage metafile="windows.xml.meta">
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <parentdocument href="./">Platform Specific Notes</parentdocument>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <title>Using Apache HTTP Server on Microsoft Windows</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>This document explains how to install, configure and run
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Apache 2.&httpd.minor; under Microsoft Windows. If you have questions after
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance reviewing the documentation (and any event and error logs), you
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu should consult the peer-supported
be2439588008221e691321fdf4f75432cfb72878Felix Gabriel Mance <a href="http://httpd.apache.org/userslist.html">users' mailing
fc05327b875b5723b6c17849b83477f29ec12c90Felix Gabriel Mance <p>This document assumes that you are installing a binary
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu distribution of Apache. If you want to compile Apache yourself
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu (possibly to help with development or tracking down bugs),
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu see <a href="win_compiling.html">Compiling Apache for Microsoft
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <title>Operating System Requirements</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>The primary Windows platform for running Apache 2.&httpd.minor; is Windows
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu 2000 or later. Always obtain and
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu install the current service pack to avoid operating system bugs.</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <note>Apache HTTP Server versions later than 2.2 will not run on any
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu operating system earlier than Windows 2000.</note>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <title>Downloading Apache for Windows</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>The Apache HTTP Server Project itself does not provide binary releases of
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu software, only source code. If you cannot compile the Apache HTTP Server
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu yourself, you can obtain a binary package from numerous binary distributions
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu available on the Internet.</p>
be00381168b3f10192afabbba136fb06d3a9f358Christian Maeder <title>Customizing Apache for Windows</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>Apache is configured by the files in the <code>conf</code>
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance subdirectory. These are the same files used to configure the Unix
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu version, but there are a few different directives for Apache on
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Windows. See the <a href="/mod/directives.html">directive index</a>
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance for all the available directives.</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>The main differences in Apache for Windows are:</p>
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance <li><p>Because Apache for Windows is multithreaded, it does not
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance use a separate process for each request, as Apache can on Unix.
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance Instead there are usually only two Apache processes running: a
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance parent process, and a child which handles the requests. Within
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance the child process each request is handled by a separate thread.
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance <p>The process management directives are also different:</p>
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance <p><directive module="mpm_common">MaxConnectionsPerChild</directive>:
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder Like the Unix directive, this controls how many connections a single
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance child process will serve before exiting.
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance However, unlike on Unix, a replacement process is not instantly
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance available. Use the default <code>MaxConnectionsPerChild 0</code>,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu unless instructed to change the behavior to overcome a memory leak
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu in third party modules or in-process applications.</p>
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance <note type="warning"><strong>Warning: The server configuration
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu file is reread when a new child process is started. If you have
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu modified <code>httpd.conf</code>, the new child may not start or
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance you may receive unexpected results.</strong></note>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p><directive module="mpm_common">ThreadsPerChild</directive>:
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu This directive is new. It tells the server how many threads it
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance should use. This is the maximum number of connections the server
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance can handle at once, so be sure to set this number high enough for
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance your site if you get a lot of hits. The recommended default is
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <code>ThreadsPerChild 150</code>, but this must be adjusted to
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder reflect the greatest anticipated number of simultaneous
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <li><p>The directives that accept filenames as arguments must use
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Windows filenames instead of Unix ones. However, because Apache
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu may interpret backslashes as an "escape character" sequence, you
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance should consistently use forward slashes in path names, not
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>While filenames are generally case-insensitive on
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Windows, URLs are still treated internally as case-sensitive
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu before they are mapped to the filesystem. For example, the
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="core" type="section">Location</directive>,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="mod_alias">Alias</directive>, and <directive
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu module="mod_proxy">ProxyPass</directive> directives all use
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu case-sensitive arguments. For this reason, it is particularly
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu important to use the <directive module="core"
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu type="section">Directory</directive> directive when attempting
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu to limit access to content in the filesystem, since this
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu directive applies to any content in a directory, regardless of
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu how it is accessed. If you wish to assure that only lowercase
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu is used in URLs, you can use something like:</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae BungiuRewriteEngine On
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae BungiuRewriteMap lowercase int:tolower
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae BungiuRewriteCond %{REQUEST_URI} [A-Z]
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae BungiuRewriteRule (.*) ${lowercase:$1} [R,L]
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>When running, Apache needs write access only to the logs
656f17ae9b7610ff2de1b6eedeeadea0c3bcdc8dChristian Maeder directory and any configured cache directory tree. Due to the
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance issue of case insensitive and short 8.3 format names, Apache must
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance validate all path names given. This means that each directory
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance which Apache evaluates, from the drive root up to the directory
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance leaf, must have read, list and traverse directory permissions.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu If Apache2.&httpd.minor; is installed at C:\Program Files, then the root
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu directory, Program Files and Apache2.&httpd.minor; must all be visible
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>Apache for Windows contains the ability to load modules at
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu runtime, without recompiling the server. If Apache is compiled
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu normally, it will install a number of optional modules in the
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <code>\Apache2.&httpd.minor;\modules</code> directory. To activate these or
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu other modules, the new <directive module="mod_so">LoadModule</directive>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu directive must be used. For example, to activate the status
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder module, use the following (in addition to the status-activating
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu directives in <code>access.conf</code>):</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu LoadModule status_module modules/mod_status.so
06acd8a23b2f06e7b2373d53f738cf56c7f03223Francisc Nicolae Bungiu <p>Information on <a href="/mod/mod_so.html#creating">creating
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu loadable modules</a> is also available.</p></li>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>Apache can also load ISAPI (Internet Server Application
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Programming Interface) extensions such as those used by Microsoft
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu IIS and other Windows servers. <a href="/mod/mod_isapi.html">More
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu information is available</a>. Note that Apache <strong>cannot</strong>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu load ISAPI Filters, and ISAPI Handlers with some Microsoft feature
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>When running CGI scripts, the method Apache uses to find
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu the interpreter for the script is configurable using the
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="core">ScriptInterpreterSource</directive>
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder <li><p>Since it is often difficult to manage files with names
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder like <code>.htaccess</code> in Windows, you may find it useful to
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu change the name of this per-directory configuration file using
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu the <directive module="core">AccessFilename</directive>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <li><p>Any errors during Apache startup are logged into the
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Windows event log when running on Windows NT. This mechanism
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu acts as a backup for those situations where Apache is not yet
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu prepared to use the <code>error.log</code> file. You can
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance review the Windows Application Event Log by using the Event Viewer,
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance e.g. Start - Settings - Control Panel - Administrative Tools
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <title>Running Apache as a Service</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>Apache comes with a utility called the Apache Service Monitor.
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder With it you can see and manage the state of all installed Apache
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance services on any machine on your network. To be able to manage an
be00381168b3f10192afabbba136fb06d3a9f358Christian Maeder Apache service with the monitor, you have to first install the
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance service (either automatically via the installation or manually).
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>You can install Apache as a Windows NT service as follows from
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu the command prompt at the Apache <code>bin</code> subdirectory:</p>
httpd.exe -k install -n "MyServiceName"
httpd.exe -k uninstall
httpd.exe -k uninstall -n "MyServiceName"
httpd.exe -n "MyServiceName" -t
httpd.exe -k start -n "MyServiceName"
httpd.exe -k stop -n "MyServiceName"
httpd.exe -k shutdown -n "MyServiceName"
httpd.exe -k restart -n "MyServiceName"
service runs as read and execute (RX) access to the whole Apache2.&httpd.minor;
you follow the instructions below to try starting httpd.exe from
httpd.exe -k shutdown
httpd.exe -k restart
more < error.log
httpd.exe -n "MyServiceName"
httpd.exe -V