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