windows.html.en revision 6954edc623ca2c179eb5b33e97e4304d06fd649f
842ae4bd224140319ae7feec1872b93dfd491143fielding<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
842ae4bd224140319ae7feec1872b93dfd491143fielding<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
842ae4bd224140319ae7feec1872b93dfd491143fielding This file is generated from xml source: DO NOT EDIT
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<title>Using Apache with Microsoft Windows - Apache HTTP Server</title>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<p class="apache">Apache HTTP Server Version 2.1</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.1</a> > <a href="./">Platform Specific Notes</a></div><div id="page-content"><div id="preamble"><h1>Using Apache with Microsoft Windows</h1>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung<p><span>Available Languages: </span><a href="/en/platform/windows.html" title="English"> en </a> |
baf4649272f3dabd48b095a23b3180cc0105dce6rjung<a href="/ko/platform/windows.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <p>This document explains how to install, configure and run
e302f38fd646764ce1a1e1c578d794aef514a9e5sf Apache 2.0 under Microsoft Windows. If you find any bugs, or
e302f38fd646764ce1a1e1c578d794aef514a9e5sf wish to contribute in other ways, please use our <a href="http://httpd.apache.org/bug_report.html">bug reporting
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>This document assumes that you are installing a binary
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz distribution of Apache. If you want to compile Apache yourself
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz (possibly to help with development or tracking down bugs),
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz see <a href="win_compiling.html">Compiling Apache for Microsoft
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p><strong>Because of the current versioning policies on Microsoft
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz Windows operating system families, this document assumes the
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><strong>Windows NT:</strong> This means all versions of
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz Windows that are based on the Windows NT kernel. Includes Windows
8f54dc133e1a89300196d85dd6f910962007cf68brianp NT, Windows 2000, Windows XP and Windows .Net Server 2003.</li>
8f54dc133e1a89300196d85dd6f910962007cf68brianp consumer-oriented versions of Windows. Includes Windows 95 (also
8f54dc133e1a89300196d85dd6f910962007cf68brianp OSR2), Windows 98 and Windows ME.</li>
8f54dc133e1a89300196d85dd6f910962007cf68brianp<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#req">Operating System Requirements</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#down">Downloading Apache for Windows</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#inst">Installing Apache for Windows</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#cust">Customizing Apache for Windows</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#winsvc">Running Apache as a Service</a></li>
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh<li><img alt="" src="/images/down.gif" /> <a href="#wincons">Running Apache as a Console Application</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#test">Testing the Installation</a></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<h2><a name="req" id="req">Operating System Requirements</a></h2>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>The primary Windows platform for running Apache 2.0 is Windows
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz NT. The binary installer only works with the x86 family of
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz processors, such as Intel and AMD processors. Running Apache on
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz Windows 9x is not thoroughly tested, and it is never recommended on
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz production systems.
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh <p>On all operating systems, TCP/IP networking must be installed
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz and working. If running on Windows 95, the Winsock 2 upgrade must
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz be installed. Winsock 2 for Windows 95 can be downloaded from <a href="http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp">here</a>.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>On Windows NT 4.0, installing Service Pack 6 is strongly
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz recommended, as Service Pack 4 created known issues with TCP/IP
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz and Winsock integrity that were resolved in later Service Packs.</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<h2><a name="down" id="down">Downloading Apache for Windows</a></h2>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>Information on the latest versions of Apache can be found on the
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz web site of the Apache web server at
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a>.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz There you will find the current release, as well as more recent alpha
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz or beta test versions, and a list of HTTP and FTP mirrors from which
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz you can download the Apache web server. Please use a mirror near to
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz you for a fast and reliable download.</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>For Windows installations you should download the version of
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz Apache for Windows with the <code>.msi</code> extension. This is a
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz single Microsoft Installer file, which contains a ready-to-run
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz version of Apache. There is a separate <code>.zip</code> file,
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz which contains only the source code. You can compile Apache
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz yourself with the Microsoft Visual C++ (Visual Studio) tools.</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz<h2><a name="inst" id="inst">Installing Apache for Windows</a></h2>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>You need Microsoft Installer 1.2 or above for the installation
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz to work. On Windows 9x you can update your Microsoft Installer to
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz version 2.0 <a href="http://www.microsoft.com/downloads/release.asp?ReleaseID=32831">here</a>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz and on Windows NT 4.0 and 2000 the version 2.0 update can be found
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <a href="http://www.microsoft.com/downloads/release.asp?ReleaseID=32832">here</a>.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz Windows XP does not need this update.</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>Note that you cannot install two versions of Apache 2.0 on the
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz same computer with the binary installer. You can, however, install
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz a version of the 1.3 series <strong>and</strong> a version of the
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz 2.0 series on the same computer without problems. If you need to
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz have two different 2.0 versions on the same computer, you have to
93ef028b3ac7dc86ec72204233b9d99c69587c54striker <a href="win_compiling.html">compile and install Apache from the
35b9e4d5f3452cad4b3bec6829ce87a5ce9e9227striker <p>Run the Apache <code>.msi</code> file you downloaded above. The
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz installation will ask you for these things:</p>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>Network Domain.</strong> Enter the DNS domain in which
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz your server is or will be registered in. For example, if your
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh server's full DNS name is <code>server.mydomain.net</code>, you would
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>Server Name.</strong> Your server's full DNS name.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz From the example above, you would type <code>server.mydomain.net</code>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>Administrator's Email Address.</strong> Enter the
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz server administrator's or webmaster's email address here. This
35b9e4d5f3452cad4b3bec6829ce87a5ce9e9227striker address will be displayed along with error messages to the client
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>For whom to install Apache</strong> Select <code>for
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz All Users, on Port 80, as a Service - Recommended</code> if you'd
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz like your new Apache to listen at port 80 for incoming traffic.
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh It will run as a service (that is, Apache will run even if no one
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz is logged in on the server at the moment) Select <code>only for
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz the Current User, on Port 8080, when started Manually</code> if
738236127338633bda6136e4715cc1973997b21cbrianp you'd like to install Apache for your personal experimenting or
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz if you already have another WWW server running on port 80.</p></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>The installation type.</strong> Select <code>Typical</code>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz for everything except the source code and libraries for module
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh development. With <code>Custom</code> you can specify what to
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz install. A full install will require about 13 megabytes of free
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz disk space. This does <em>not</em> include the size of your web
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <li><p><strong>Where to install.</strong> The default path is
01e8aca9299a0b872414c24c8b7724d6f88ae665ianh <code>C:\Program Files\Apache Group</code> under which a directory
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz called <code>Apache2</code> will be created by default.</p></li>
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz <p>During the installation, Apache will configure the files in the
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <code>conf</code> subdirectory to reflect the chosen installation
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp directory. However, if any of the configuration files in this
baf4649272f3dabd48b095a23b3180cc0105dce6rjung directory already exist, they will not be overwritten. Instead, the
baf4649272f3dabd48b095a23b3180cc0105dce6rjung new copy of the corresponding file will be left with the extension
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <code>.default</code>. So, for example, if <code>conf\httpd.conf</code>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung already exists, it will be renamed as <code>conf\httpd.conf.default</code>.
baf4649272f3dabd48b095a23b3180cc0105dce6rjung After the installation you should manually check to see what new
baf4649272f3dabd48b095a23b3180cc0105dce6rjung settings are in the <code>.default</code> file, and if necessary,
baf4649272f3dabd48b095a23b3180cc0105dce6rjung update your existing configuration file.</p>
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <p>Also, if you already have a file called <code>htdocs\index.html</code>,
35b9e4d5f3452cad4b3bec6829ce87a5ce9e9227striker it will not be overwritten (and no <code>index.html.default</code>
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp will be installed either). This means it should be safe to install
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp Apache over an existing installation, although you would have to
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp stop the existing running server before doing the installation, and
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp then start the new one after the installation is finished.</p>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <p>After installing Apache, you must edit the configuration files
baf4649272f3dabd48b095a23b3180cc0105dce6rjung in the <code>conf</code> subdirectory as required. These files
baf4649272f3dabd48b095a23b3180cc0105dce6rjung will be configured during the installation so that Apache is ready
e302f38fd646764ce1a1e1c578d794aef514a9e5sf to be run from the directory it was installed into, with the
e302f38fd646764ce1a1e1c578d794aef514a9e5sf documents server from the subdirectory <code>htdocs</code>. There
e302f38fd646764ce1a1e1c578d794aef514a9e5sf are lots of other options which you should set before you really
e302f38fd646764ce1a1e1c578d794aef514a9e5sf start using Apache. However, to get started quickly, the files
e302f38fd646764ce1a1e1c578d794aef514a9e5sf should work as installed.</p>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung<h2><a name="cust" id="cust">Customizing Apache for Windows</a></h2>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <p>Apache is configured by the files in the <code>conf</code>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung subdirectory. These are the same files used to configure the Unix
baf4649272f3dabd48b095a23b3180cc0105dce6rjung version, but there are a few different directives for Apache on
baf4649272f3dabd48b095a23b3180cc0105dce6rjung Windows. See the <a href="/mod/directives.html">directive index</a>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung for all the available directives.</p>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <p>The main differences in Apache for Windows are:</p>
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <li><p>Because Apache for Windows is multithreaded, it does not
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp use a separate process for each request, as Apache does on Unix.
baf4649272f3dabd48b095a23b3180cc0105dce6rjung Instead there are usually only two Apache processes running: a
baf4649272f3dabd48b095a23b3180cc0105dce6rjung parent process, and a child which handles the requests. Within
e302f38fd646764ce1a1e1c578d794aef514a9e5sf the child process each request is handled by a separate thread.
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <p>The process management directives are also different:</p>
e302f38fd646764ce1a1e1c578d794aef514a9e5sf <p><code class="directive"><a href="/mod/mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></code>:
e302f38fd646764ce1a1e1c578d794aef514a9e5sf Like the Unix directive, this controls how many requests a single
e302f38fd646764ce1a1e1c578d794aef514a9e5sf child process will serve before exiting. However, unlike on Unix,
e302f38fd646764ce1a1e1c578d794aef514a9e5sf a single process serves all the requests at once, not just one.
e302f38fd646764ce1a1e1c578d794aef514a9e5sf If this is set, it is recommended that a very high number is
e302f38fd646764ce1a1e1c578d794aef514a9e5sf used. The recommended default, <code>MaxRequestsPerChild 0</code>,
e302f38fd646764ce1a1e1c578d794aef514a9e5sf causes the child process to never exit.</p>
e302f38fd646764ce1a1e1c578d794aef514a9e5sf <div class="warning"><strong>Warning: The server configuration
e302f38fd646764ce1a1e1c578d794aef514a9e5sf file is reread when a new child process is started. If you have
e302f38fd646764ce1a1e1c578d794aef514a9e5sf modified <code>httpd.conf</code>, the new child may not start or
e302f38fd646764ce1a1e1c578d794aef514a9e5sf <p><code class="directive"><a href="/mod/mpm_common.html#threadsperchild">ThreadsPerChild</a></code>:
e302f38fd646764ce1a1e1c578d794aef514a9e5sf This directive is new. It tells the server how many threads it
e302f38fd646764ce1a1e1c578d794aef514a9e5sf should use. This is the maximum number of connections the server
e302f38fd646764ce1a1e1c578d794aef514a9e5sf can handle at once, so be sure to set this number high enough for
e302f38fd646764ce1a1e1c578d794aef514a9e5sf your site if you get a lot of hits. The recommended default is
e302f38fd646764ce1a1e1c578d794aef514a9e5sf <li><p>The directives that accept filenames as arguments must use
e302f38fd646764ce1a1e1c578d794aef514a9e5sf Windows filenames instead of Unix ones. However, because Apache
e302f38fd646764ce1a1e1c578d794aef514a9e5sf uses Unix-style names internally, you must use forward slashes,
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp not backslashes. Drive letters can be used; if omitted, the drive
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <li><p>Apache for Windows contains the ability to load modules at
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp runtime, without recompiling the server. If Apache is compiled
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp normally, it will install a number of optional modules in the
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <code>\Apache2\modules</code> directory. To activate these or
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp other modules, the new <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code>
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp directive must be used. For example, to activate the status
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp module, use the following (in addition to the status-activating
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <p>Information on <a href="/mod/mod_so.html#creating">creating
baf4649272f3dabd48b095a23b3180cc0105dce6rjung <li><p>Apache can also load ISAPI (Internet Server Application
e302f38fd646764ce1a1e1c578d794aef514a9e5sf Programming Interface) extensions (i.e. internet server
e302f38fd646764ce1a1e1c578d794aef514a9e5sf applications), such as those used by Microsoft IIS and other
e302f38fd646764ce1a1e1c578d794aef514a9e5sf Windows servers. <a href="/mod/mod_isapi.html">More information
e302f38fd646764ce1a1e1c578d794aef514a9e5sf is available</a>. Note that Apache <strong>cannot</strong> load
e302f38fd646764ce1a1e1c578d794aef514a9e5sf <li><p>When running CGI scripts, the method Apache uses to find
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp the interpreter for the script is configurable using the
b5033962c73a470b6f36a3ac796c542a6ab4ddf6brianp <code class="directive"><a href="/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</a></code>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <li><p>Since it is often difficult to manage files with names
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp like <code>.htaccess</code> in Windows, you may find it useful to
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp change the name of this per-directory configuration file using
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp the <code class="directive"><a href="/mod/core.html#accessfilename">AccessFilename</a></code>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <li><p>Any errors during Apache startup are logged into the
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp Windows event log when running on Windows NT. This mechanism
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp acts as a backup for those situations where Apache cannot even
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp access the normally used <code>error.log</code> file. You can
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp view the Windows event log by using the Event Viewer application
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp on Windows NT 4.0, and the Event Viewer MMC snap-in on newer
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp versions of Windows.</p>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <div class="note"><strong>Note that there is no startup error logging on
eec984329ef5e5916b7554a5b2b585d7a1a1202dbrianp Windows 9x because no Windows event log exists on those operating
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp<h2><a name="winsvc" id="winsvc">Running Apache as a Service</a></h2>
eec984329ef5e5916b7554a5b2b585d7a1a1202dbrianp <p>Apache can be run as a service on Windows NT. There is some
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp highly experimental support for similar behavior on Windows 9x.</p>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <p>You can install Apache as a service automatically during the
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp installation. If you chose to install for all users, the
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp installation will create an Apache service for you. If you specify
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp to install for yourself only, you can manually register Apache as a
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp service after the installation. You have to be a member of the
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp Administrators group for the service installation to succeed.</p>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <p>Apache comes with a utility called the Apache Service Monitor.
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp With it you can see and manage the state of all installed Apache
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp services on any machine on your network. To be able to manage an
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp Apache service with the monitor, you have to first install the
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp service (either automatically via the installation or manually).
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <p>You can install Apache as a Windows NT service as follows from
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp the command prompt at the Apache <code>bin</code> subdirectory:</p>
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp apache -k install
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp <p>If you need to specify the name of the service you want to
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp install, use the following command. You have to do this if you
f48a3dc705ff69288cb5af136a2cd753f45d6572brianp have several different service installations of Apache on your
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim computer.</p>
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim apache -k install -n "MyServiceName"
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim <p>If you need to have specifically named configuration files for
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim different services, you must use this:</p>
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim apache -k install -n "MyServiceName" -f "c:\files\my.conf"
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim <p>If you use the first command without any special parameters except
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim <code>-k install</code>, the service will be called <code>Apache2</code>
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159jim and the configuration will be assumed to be <code>conf\httpd.conf</code>.
such as incorrect entries in the httpd.conf configuration file,
more < error.log
apache -f "c:\my server files\anotherconfig.conf"
apache -f files\anotherconfig.conf
<p>Apache will then try to determine its <code class="directive"><a href="/mod/core.html# serverroot">
this file contains a <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code>
<p><span>Available Languages: </span><a href="/en/platform/windows.html" title="English"> en </a> |
<a href="/ko/platform/windows.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
<p class="apache">Copyright 1999-2004 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>