You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2002/09/16 17:41:32 UTC

cvs commit: httpd-2.0/docs/manual/platform win_compiling.html.en win_compiling.xml win_service.html.en win_service.xml windows.html.en windows.xml win_compiling.html win_service.html windows.html

nd          2002/09/16 08:41:31

  Added:       docs/manual/platform win_compiling.html.en win_compiling.xml
                        win_service.html.en win_service.xml windows.html.en
                        windows.xml
  Removed:     docs/manual/platform win_compiling.html win_service.html
                        windows.html
  Log:
  new XML
  
  Submitted by: Tim Gerundt <ti...@gerundt.de>
  
  Revision  Changes    Path
  1.1                  httpd-2.0/docs/manual/platform/win_compiling.html.en
  
  Index: win_compiling.html.en
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                This file is generated from xml source: DO NOT EDIT
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        --><title>Compiling Apache for Microsoft Windows - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body id="manual-page"><div id="page-header"><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><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.0</a></div><div id="page-content"><div id="preamble"><h1>Compiling Apache for Microsoft Windows</h1>
  
      <p>There are many important points before you begin compiling
      Apache. See <a href="windows.html">Using Apache with Microsoft
      Windows</a> before you begin.</p>
  
    </div><div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#requirements">Requirements</a></li><li><img alt="" src="../images/down.gif" /> <a href="#commandbuild">Command-Line Build</a></li><li><img alt="" src="../images/down.gif" /> <a href="#workspacebuild">Developer Studio Workspace IDE Build</a></li><li><img alt="" src="../images/down.gif" /> <a href="#projectcomponents">Project Components</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="requirements" id="requirements">Requirements</a></h2>
  
      
  
      <p>Compiling Apache requires the following environment to be
      properly installed:</p>
  
      <ul>
        <li>
          <p>Disk Space</p>
          <p>Make sure you have at least 50 MB of free disk space
          available. After installation Apache requires approximately
          10 MB of disk space, plus space for log and cache files,
          which can grow rapidly. The actual disk space requirements
          will vary considerably based on your chosen configuration and
          any third-party modules or libraries.</p>
        </li>
  
        <li>
          <p>Microsoft Visual C++ 5.0 or higher.</p>
          <p>Apache can be built using the command line tools, or from
          within the Visual Studio IDE Workbench.  The command line
          build requires the environment to reflect the <code>PATH</code>,
          <code>INCLUDE</code>, <code>LIB</code> and other variables
          that can be configured with the <code>vcvars32</code> batch file:</p>
  
          <div class="example"><p><code>
            "c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
          </code></p></div>
        </li>
  
        <li>
          <p>The Windows Platform SDK.</p>
          <p>Visual C++ 5.0 builds require an updated Microsoft Windows
          Platform SDK to enable some Apache features. For command line
          builds, the Platform SDK environment is prepared by the
          <code>setenv</code> batch file:</p>
  
          <div class="example"><p><code>
            "c:\Program Files\Platform SDK\setenv.bat"
          </code></p></div>
  
          <p>The Platform SDK files distributed with Visual C++ 6.0 and
          later are sufficient, so users of later version may skip
          this requirement.</p>
  
          <div class="note">Note that the Windows Platform SDK update is required
          to enable all supported <code class="module"><a href="../mod/mod_isapi.html">mod_isapi</a></code> features.
          Without a recent update, Apache will issue warnings under
          MSVC++ 5.0 that some <code class="module"><a href="../mod/mod_isapi.html">mod_isapi</a></code> features
          will be disabled. Look for the update at <a href="http://msdn.microsoft.com/downloads/sdks/platform/platform.asp">http://msdn.microsoft.com/downloads/sdks/platform/platform.asp</a>.</div>
        </li>
  
        <li>
          <p>The awk utility (awk, gawk or similar).</p>
          <p>To install Apache within the build system, several files are
          modified using the <code>awk.exe</code> utility. awk was chosen since it
          is a very small download (compared with Perl or WSH/VB) and
          accomplishes the task of generating files. Brian Kernighan's
          <a href="http://cm.bell-labs.com/cm/cs/who/bwk/">http://cm.bell-labs.com/cm/cs/who/bwk/</a>
          site has a compiled native Win32 binary,
          <a href="http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe">http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe</a> which
          you must save with the name <code>awk.exe</code> rather than
          <code>awk95.exe</code>.</p>
  
          <div class="note">Note that Developer Studio IDE will only find
          <code>awk.exe</code> from the Tools menu Options... Directories
          tab (the Projects - VC++ Directories pane in Developer Studio 7.0)
          listing Executable file paths. Add the path for <code>awk.exe</code>
          to this list, and your system <code>PATH</code> environment variable,
          as needed.</div>
  
          <div class="note">Also note that if you are using Cygwin (<a href="http://www.cygwin.com/">http://www.cygwin.com/</a>) the awk utility is named <code>gawk.exe</code> and
          that the file <code>awk.exe</code> is really a symlink to the <code>gawk.exe</code>
          file. The Windows command shell does not recognize symlinks, and because of that
          building InstallBin will fail. A workaround is to delete <code>awk.exe</code> from
          the cygwin installation and rename <code>gawk.exe</code> to <code>awk.exe</code>.</div>
        </li>
  
        <li>
          <p>[Optional] OpenSSL libraries (for <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
          and <code>ab.exe</code> with ssl support)</p>
          <p><strong>Caution: there are significant restrictions and
          prohibitions on the use and distribution of strong cryptography
          and patented intellectual property throughout the world.</strong>
          OpenSSL includes strong cryptography controlled by both export
          regulations and domestic law, as well as intellectual property
          protected by patent, in the United States and elsewhere.  Neither
          the Apache Software Foundation nor the OpenSSL project can provide
          legal advise regarding possession, use, or distribution of the code
          provided by the OpenSSL project. <strong>Consult your own legal
          counsel, you are responsible for your own actions.</strong></p>
  
          <p>OpenSSL must be installed into a <code>srclib</code> subdirectory named
          <code>openssl</code>, obtained from <a href="http://www.openssl.org/source/">http://www.openssl.org/source/</a>, in order to compile <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
          or the abs project (<code>ab.exe</code> with SSL support.) To prepare OpenSSL
          for both <code>release</code> and <code>debug</code> builds of Apache, and
          disable the patent protected features in 0.9.6,  you might use the following
          build commands:</p>
  
          <div class="example"><p><code>
            perl util\mkfiles.pl &gt;MINFO<br />
            perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile<br />
            perl util\mk1mf.pl dll debug no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile.dbg<br />
            perl util\mkdef.pl 32 libeay no-asm no-mdc2 no-rc5 no-idea &gt;ms\libeay32.def<br />
            perl util\mkdef.pl 32 ssleay no-asm no-mdc2 no-rc5 no-idea &gt;ms\ssleay32.def<br />
            nmake<br />
            nmake -f makefile.dbg
          </code></p></div>
  
        </li>
  
        <li>
          <p>[Optional] zlib sources (for <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>)</p>
          <p>Zlib must be installed into a <code>srclib</code> subdirectory named
          <code>zlib</code>, however those sources need not be compiled. The build system
          will compile the compression sources directly into the <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>
          module. Zlib can be obtained from <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a> -- <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code> is
          confirmed to build correctly with version 1.1.4.</p>
        </li>
  
      </ul>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="commandbuild" id="commandbuild">Command-Line Build</a></h2>
  
      
  
      <p>First, unpack the Apache distribution into an appropriate
      directory. Open a command-line prompt and <code>cd</code> to that
      directory.</p>
  
      <p>The master Apache makefile instructions are contained in the
      <code>Makefile.win</code> file. To compile Apache on Windows
      NT, simply use one of the following commands to compiled the
      <code>release</code> or <code>debug</code> build, respectively:</p>
  
      <div class="example"><pre>
  nmake /f Makefile.win _apacher
  
  nmake /f Makefile.win _apached
      </pre></div>
  
      <p>Either command will compile Apache. The latter will include
      debugging information in the resulting files, making it easier
      to find bugs and track down problems.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="workspacebuild" id="workspacebuild">Developer Studio Workspace IDE Build</a></h2>
  
      
  
      <p>Apache can also be compiled using VC++'s Visual Studio
      development environment. To simplify this process, a
      Visual Studio workspace, <code>Apache.dsw</code>, is provided.
      This workspace exposes the entire list of working <code>.dsp</code>
      projects that are required for the complete Apache binary release.
      It includes dependencies between the projects to assure that they
      are built in the appropriate order.</p>
  
      <p>Open the <code>Apache.dsw</code> workspace, and select
      <code>InstallBin</code> (<code>Release</code> or <code>Debug</code> build,
      as desired) as the Active Project. <code>InstallBin</code> causes all
      related project to be built, and then invokes <code>Makefile.win</code> to
      move the compiled executables and dlls. You may personalize the
      <code>INSTDIR=</code> choice by changing <code>InstallBin</code>'s Settings,
      General tab, Build command line entry. <code>INSTDIR</code> defaults to the
      <code>/Apache2</code> directory. If you only want a test compile (without
      installing) you may build the <code>BuildBin</code> project instead.</p>
  
      <p>The <code>.dsp</code> project files are distributed in Visual
      C++ 6.0 format. Visual C++ 5.0 (97) will recognize them. Visual C++
      7.0 (.net) must convert <code>Apache.dsw</code> plus the <code>.dsp</code>
      files into an <code>Apache.sln</code> plus <code>.msproj</code> files,
      be sure you reconvert the <code>.msproj</code> file if any of the source
      <code>.dsp</code> files change! This is really trivial, just open
      <code>Apache.dsw</code> in the VC++ 7.0 IDE once again.</p>
  
      <p>Visual C++ 7.0 (.net) users should also use the Build
      menu, Configuration Manager dialog to uncheck both the <code>Debug</code>
      and <code>Release</code> Solution modules abs, <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
      and <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.
      These modules are built by invoking <code>nmake</code> or the IDE directly
      with the <code>BinBuild</code> target to build those modules explicitly,
      only if the <code>srclib</code> directories <code>openssl</code>
      and/or <code>zlib</code> exist.</p>
  
      <p>Exported <code>.mak</code> files pose a greater hassle, but they are
      required for Visual C++ 5.0 users to build <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>,
      abs (ab with SSL support) and/or <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.
      VC++ 7.0 (.net) users also benefit, <code>nmake</code> builds
      are faster than <code>binenv</code> builds.
      Build the entire project from within the VC++ 5.0 or 6.0 IDE,
      then use the Project Menu Export for all makefiles.
      You must build the projects first in order to create all dynamic
      auto-generated targets, so that dependencies can be parsed
      correctly. Run the following command to fix the paths so they
      will build anywhere:</p>
  
      <div class="example"><p><code>
        perl srclib\apr\build\fixwin32mak.pl
      </code></p></div>
  
      <p>You must type this command from the <em>top level</em>
      directory of the <code>httpd</code> source tree. Every
      <code>.mak</code> and <code>.dep</code> project file within
      the current directory and below will be corrected, and the
      timestamps adjusted to reflect the <code>.dsp</code>.</p>
  
      <p>If you contribute back a patch that revises project files, we
      must commit project files in Visual Studio 6.0 format. Changes
      should be simple, with minimal compilation and linkage flags that
      will be recognized by all VC++ 5.0 through 7.0 environments.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="projectcomponents" id="projectcomponents">Project Components</a></h2>
  
      
  
      <p>The <code>Apache.dsw</code> workspace and <code>makefile.win</code>
      <code>nmake</code> script both build the <code>.dsp</code> projects
      of the Apache server in the following sequence:</p>
  
      <ol>
        <li><code>srclib\apr\apr.dsp</code></li>
  
        <li><code>srclib\apr\libapr.dsp</code></li>
  
        <li><code>srclib\apr-util\uri\gen_uri_delims.dsp</code></li>
  
        <li><code>srclib\apr-util\xml\expat\lib\xml.dsp</code></li>
  
        <li><code>srclib\apr-util\aprutil.dsp</code></li>
  
        <li><code>srclib\apr-util\libaprutil.dsp</code></li>
  
        <li><code>srclib\pcre\dftables.dsp</code></li>
  
        <li><code>srclib\pcre\pcre.dsp</code></li>
  
        <li><code>srclib\pcre\pcreposix.dsp</code></li>
  
        <li><code>server\gen_test_char.dsp</code></li>
  
        <li><code>libhttpd.dsp</code></li>
  
        <li><code>Apache.dsp</code></li>
      </ol>
  
      <p>In addition, the <code>modules\</code> subdirectory tree contains
      project files for the majority of the modules.</p>
  
      <p>The <code>support\</code> directory contains project files for
      additional programs that are not part of the Apache runtime,
      but are used by the administrator to test Apache and maintain
      password and log files. Windows-specific support projects are
      broken out in the <code>support\win32\</code> directory.</p>
  
      <ol>
        <li><code>support\ab.dsp</code></li>
  
        <li><code>support\htdigest.dsp</code></li>
  
        <li><code>support\htpasswd.dsp</code></li>
  
        <li><code>support\logresolve.dsp</code></li>
  
        <li><code>support\rotatelogs.dsp</code></li>
  
        <li><code>support\win32\ApacheMonitor.dsp</code></li>
  
        <li><code>support\win32\wintty.dsp</code></li>
      </ol>
  
      <p>Once Apache has been compiled, it needs to be installed in
      its server root directory. The default is the
      <code>\Apache2</code> directory, of the same drive.</p>
  
      <p>To build and install all the files into the desired folder
      <em>dir</em> automatically, use one of the following
      <code>nmake</code> commands:</p>
  
      <div class="example"><pre>
  nmake /f Makefile.win installr INSTDIR=<em>dir</em>
  
  nmake /f Makefile.win installd INSTDIR=<em>dir</em>
      </pre></div>
  
      <p>The <em>dir</em> argument to <code>INSTDIR</code> gives
      the installation directory; it can be omitted if Apache is
      to be installed into <code>\Apache2</code>.</p>
  
      <p>This will install the following:</p>
  
      <ul>
        <li><code><em>dir</em>\bin\Apache.exe</code> - Apache
        executable</li>
  
        <li><code><em>dir</em>\bin\ApacheMonitor.exe</code> - Service
        monitor taskbar icon utility</li>
  
        <li><code><em>dir</em>\bin\htdigest.exe</code> - Digest auth
        password file utility</li>
  
        <li><code><em>dir</em>\bin\htdbm.exe</code> - SDBM auth
        database password file utility</li>
  
        <li><code><em>dir</em>\bin\htpasswd.exe</code> - Basic auth
        password file utility</li>
  
        <li><code><em>dir</em>\bin\logresolve.exe</code> - Log file
        dns name lookup utility</li>
  
        <li><code><em>dir</em>\bin\rotatelogs.exe</code> - Log file
        cycling utility</li>
  
        <li><code><em>dir</em>\bin\wintty.exe</code> - Console window
        utility</li>
  
        <li><code><em>dir</em>\bin\libapr.dll</code> - Apache
        Portable Runtime shared library</li>
  
        <li><code><em>dir</em>\bin\libaprutil.dll</code> - Apache
        Utility Runtime shared library</li>
  
        <li><code><em>dir</em>\bin\libhttpd.dll</code> - Apache Core
        library</li>
  
        <li><code><em>dir</em>\modules\mod_*.so</code> - Loadable
        Apache modules</li>
  
        <li><code><em>dir</em>\conf</code> - Configuration
        directory</li>
  
        <li><code><em>dir</em>\logs</code> - Empty logging
        directory</li>
  
        <li><code><em>dir</em>\include</code> - C language header
        files</li>
  
        <li><code><em>dir</em>\lib</code> - Link library files</li>
      </ul>
  
      <h3><a name="projectcomponents-warn" id="projectcomponents-warn">Warning about building Apache from the development tree</a></h3>
  
        
  
        <div class="note">Note only the <code>.dsp</code> files are maintained between <code>release</code>
        builds. The <code>.mak</code> files are NOT regenerated, due to the tremendous
        waste of reviewer's time. Therefore, you cannot rely on the <code>NMAKE</code>
        commands above to build revised <code>.dsp</code> project files unless you
        then export all <code>.mak</code> files yourself from the project. This is
        unnecessary if you build from within the Microsoft
        Developer Studio environment.</div>
  
        <div class="note">Also note it is very worthwhile to build the <code>BuildBin</code>
        target project (or the command line <code>_apacher</code> or
        <code>_apached</code> target) prior to exporting the make files.
        Many files are autogenerated in the build process. Only a full
        build provides all of the dependent files required to build proper
        dependency trees for correct build behavior.</div>
  
        <p>In order to create distribution <code>.mak</code> files, always review
        the generated <code>.mak</code> (or <code>.dep</code>) dependencies for
        Platform SDK or other garbage includes. The <code>DevStudio\SharedIDE\bin\</code>
        (VC5) or <code>DevStudio\Common\MSDev98\bin\</code> (VC6) directory contains
        the <code>sysincl.dat</code> file, which must list all exceptions. Update this
        file (including both forward and backslashed paths, such as both
        <code>sys/time.h</code> and <code>sys\time.h</code>) to include such dependencies.
        Including local-install paths in a distributed <code>.mak</code> file will
        cause the build to fail completely. And don't forget to run
        <code>srclib/apr/build/fixwin32mak.pl</code> in order to fix absolute
        paths within the <code>.mak</code> files.</p>
  
      
  
    </div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</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></body></html>
  
  
  1.1                  httpd-2.0/docs/manual/platform/win_compiling.xml
  
  Index: win_compiling.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
  <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
  
  <manualpage>
    <relativepath href=".." />
  
    <title>Compiling Apache for Microsoft Windows</title>
  
    <summary>
  
      <p>There are many important points before you begin compiling
      Apache. See <a href="windows.html">Using Apache with Microsoft
      Windows</a> before you begin.</p>
  
    </summary>
  
    <section id="requirements">
  
      <title>Requirements</title>
  
      <p>Compiling Apache requires the following environment to be
      properly installed:</p>
  
      <ul>
        <li>
          <p>Disk Space</p>
          <p>Make sure you have at least 50 MB of free disk space
          available. After installation Apache requires approximately
          10 MB of disk space, plus space for log and cache files,
          which can grow rapidly. The actual disk space requirements
          will vary considerably based on your chosen configuration and
          any third-party modules or libraries.</p>
        </li>
  
        <li>
          <p>Microsoft Visual C++ 5.0 or higher.</p>
          <p>Apache can be built using the command line tools, or from
          within the Visual Studio IDE Workbench.  The command line
          build requires the environment to reflect the <code>PATH</code>,
          <code>INCLUDE</code>, <code>LIB</code> and other variables
          that can be configured with the <code>vcvars32</code> batch file:</p>
  
          <example>
            "c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
          </example>
        </li>
  
        <li>
          <p>The Windows Platform SDK.</p>
          <p>Visual C++ 5.0 builds require an updated Microsoft Windows
          Platform SDK to enable some Apache features. For command line
          builds, the Platform SDK environment is prepared by the
          <code>setenv</code> batch file:</p>
  
          <example>
            "c:\Program Files\Platform SDK\setenv.bat"
          </example>
  
          <p>The Platform SDK files distributed with Visual C++ 6.0 and
          later are sufficient, so users of later version may skip
          this requirement.</p>
  
          <note>Note that the Windows Platform SDK update is required
          to enable all supported <module>mod_isapi</module> features.
          Without a recent update, Apache will issue warnings under
          MSVC++ 5.0 that some <module>mod_isapi</module> features
          will be disabled. Look for the update at <a
          href="http://msdn.microsoft.com/downloads/sdks/platform/platform.asp"
          >http://msdn.microsoft.com/downloads/sdks/platform/platform.asp</a>.</note>
        </li>
  
        <li>
          <p>The awk utility (awk, gawk or similar).</p>
          <p>To install Apache within the build system, several files are
          modified using the <code>awk.exe</code> utility. awk was chosen since it
          is a very small download (compared with Perl or WSH/VB) and
          accomplishes the task of generating files. Brian Kernighan's
          <a href="http://cm.bell-labs.com/cm/cs/who/bwk/"
          >http://cm.bell-labs.com/cm/cs/who/bwk/</a>
          site has a compiled native Win32 binary,
          <a href="http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe"
          >http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe</a> which
          you must save with the name <code>awk.exe</code> rather than
          <code>awk95.exe</code>.</p>
  
          <note>Note that Developer Studio IDE will only find
          <code>awk.exe</code> from the Tools menu Options... Directories
          tab (the Projects - VC++ Directories pane in Developer Studio 7.0)
          listing Executable file paths. Add the path for <code>awk.exe</code>
          to this list, and your system <code>PATH</code> environment variable,
          as needed.</note>
  
          <note>Also note that if you are using Cygwin (<a href="http://www.cygwin.com/"
          >http://www.cygwin.com/</a>) the awk utility is named <code>gawk.exe</code> and
          that the file <code>awk.exe</code> is really a symlink to the <code>gawk.exe</code>
          file. The Windows command shell does not recognize symlinks, and because of that
          building InstallBin will fail. A workaround is to delete <code>awk.exe</code> from
          the cygwin installation and rename <code>gawk.exe</code> to <code>awk.exe</code>.</note>
        </li>
  
        <li>
          <p>[Optional] OpenSSL libraries (for <module>mod_ssl</module>
          and <code>ab.exe</code> with ssl support)</p>
          <p><strong>Caution: there are significant restrictions and
          prohibitions on the use and distribution of strong cryptography
          and patented intellectual property throughout the world.</strong>
          OpenSSL includes strong cryptography controlled by both export
          regulations and domestic law, as well as intellectual property
          protected by patent, in the United States and elsewhere.  Neither
          the Apache Software Foundation nor the OpenSSL project can provide
          legal advise regarding possession, use, or distribution of the code
          provided by the OpenSSL project. <strong>Consult your own legal
          counsel, you are responsible for your own actions.</strong></p>
  
          <p>OpenSSL must be installed into a <code>srclib</code> subdirectory named
          <code>openssl</code>, obtained from <a href="http://www.openssl.org/source/"
          >http://www.openssl.org/source/</a>, in order to compile <module>mod_ssl</module>
          or the abs project (<code>ab.exe</code> with SSL support.) To prepare OpenSSL
          for both <code>release</code> and <code>debug</code> builds of Apache, and
          disable the patent protected features in 0.9.6,  you might use the following
          build commands:</p>
  
          <example>
            perl util\mkfiles.pl &gt;MINFO<br />
            perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile<br />
            perl util\mk1mf.pl dll debug no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile.dbg<br />
            perl util\mkdef.pl 32 libeay no-asm no-mdc2 no-rc5 no-idea &gt;ms\libeay32.def<br />
            perl util\mkdef.pl 32 ssleay no-asm no-mdc2 no-rc5 no-idea &gt;ms\ssleay32.def<br />
            nmake<br />
            nmake -f makefile.dbg
          </example>
  
        </li>
  
        <li>
          <p>[Optional] zlib sources (for <module>mod_deflate</module>)</p>
          <p>Zlib must be installed into a <code>srclib</code> subdirectory named
          <code>zlib</code>, however those sources need not be compiled. The build system
          will compile the compression sources directly into the <module>mod_deflate</module>
          module. Zlib can be obtained from <a href="http://www.gzip.org/zlib/"
          >http://www.gzip.org/zlib/</a> -- <module>mod_deflate</module> is
          confirmed to build correctly with version 1.1.4.</p>
        </li>
  
      </ul>
  
    </section>
  
    <section id="commandbuild">
  
      <title>Command-Line Build</title>
  
      <p>First, unpack the Apache distribution into an appropriate
      directory. Open a command-line prompt and <code>cd</code> to that
      directory.</p>
  
      <p>The master Apache makefile instructions are contained in the
      <code>Makefile.win</code> file. To compile Apache on Windows
      NT, simply use one of the following commands to compiled the
      <code>release</code> or <code>debug</code> build, respectively:</p>
  
      <example><pre>
  nmake /f Makefile.win _apacher
  
  nmake /f Makefile.win _apached
      </pre></example>
  
      <p>Either command will compile Apache. The latter will include
      debugging information in the resulting files, making it easier
      to find bugs and track down problems.</p>
  
    </section>
  
    <section id="workspacebuild">
  
      <title>Developer Studio Workspace IDE Build</title>
  
      <p>Apache can also be compiled using VC++'s Visual Studio
      development environment. To simplify this process, a
      Visual Studio workspace, <code>Apache.dsw</code>, is provided.
      This workspace exposes the entire list of working <code>.dsp</code>
      projects that are required for the complete Apache binary release.
      It includes dependencies between the projects to assure that they
      are built in the appropriate order.</p>
  
      <p>Open the <code>Apache.dsw</code> workspace, and select
      <code>InstallBin</code> (<code>Release</code> or <code>Debug</code> build,
      as desired) as the Active Project. <code>InstallBin</code> causes all
      related project to be built, and then invokes <code>Makefile.win</code> to
      move the compiled executables and dlls. You may personalize the
      <code>INSTDIR=</code> choice by changing <code>InstallBin</code>'s Settings,
      General tab, Build command line entry. <code>INSTDIR</code> defaults to the
      <code>/Apache2</code> directory. If you only want a test compile (without
      installing) you may build the <code>BuildBin</code> project instead.</p>
  
      <p>The <code>.dsp</code> project files are distributed in Visual
      C++ 6.0 format. Visual C++ 5.0 (97) will recognize them. Visual C++
      7.0 (.net) must convert <code>Apache.dsw</code> plus the <code>.dsp</code>
      files into an <code>Apache.sln</code> plus <code>.msproj</code> files,
      be sure you reconvert the <code>.msproj</code> file if any of the source
      <code>.dsp</code> files change! This is really trivial, just open
      <code>Apache.dsw</code> in the VC++ 7.0 IDE once again.</p>
  
      <p>Visual C++ 7.0 (.net) users should also use the Build
      menu, Configuration Manager dialog to uncheck both the <code>Debug</code>
      and <code>Release</code> Solution modules abs, <module>mod_ssl</module>
      and <module>mod_deflate</module>.
      These modules are built by invoking <code>nmake</code> or the IDE directly
      with the <code>BinBuild</code> target to build those modules explicitly,
      only if the <code>srclib</code> directories <code>openssl</code>
      and/or <code>zlib</code> exist.</p>
  
      <p>Exported <code>.mak</code> files pose a greater hassle, but they are
      required for Visual C++ 5.0 users to build <module>mod_ssl</module>,
      abs (ab with SSL support) and/or <module>mod_deflate</module>.
      VC++ 7.0 (.net) users also benefit, <code>nmake</code> builds
      are faster than <code>binenv</code> builds.
      Build the entire project from within the VC++ 5.0 or 6.0 IDE,
      then use the Project Menu Export for all makefiles.
      You must build the projects first in order to create all dynamic
      auto-generated targets, so that dependencies can be parsed
      correctly. Run the following command to fix the paths so they
      will build anywhere:</p>
  
      <example>
        perl srclib\apr\build\fixwin32mak.pl
      </example>
  
      <p>You must type this command from the <em>top level</em>
      directory of the <code>httpd</code> source tree. Every
      <code>.mak</code> and <code>.dep</code> project file within
      the current directory and below will be corrected, and the
      timestamps adjusted to reflect the <code>.dsp</code>.</p>
  
      <p>If you contribute back a patch that revises project files, we
      must commit project files in Visual Studio 6.0 format. Changes
      should be simple, with minimal compilation and linkage flags that
      will be recognized by all VC++ 5.0 through 7.0 environments.</p>
  
    </section>
  
    <section id="projectcomponents">
  
      <title>Project Components</title>
  
      <p>The <code>Apache.dsw</code> workspace and <code>makefile.win</code>
      <code>nmake</code> script both build the <code>.dsp</code> projects
      of the Apache server in the following sequence:</p>
  
      <ol>
        <li><code>srclib\apr\apr.dsp</code></li>
  
        <li><code>srclib\apr\libapr.dsp</code></li>
  
        <li><code>srclib\apr-util\uri\gen_uri_delims.dsp</code></li>
  
        <li><code>srclib\apr-util\xml\expat\lib\xml.dsp</code></li>
  
        <li><code>srclib\apr-util\aprutil.dsp</code></li>
  
        <li><code>srclib\apr-util\libaprutil.dsp</code></li>
  
        <li><code>srclib\pcre\dftables.dsp</code></li>
  
        <li><code>srclib\pcre\pcre.dsp</code></li>
  
        <li><code>srclib\pcre\pcreposix.dsp</code></li>
  
        <li><code>server\gen_test_char.dsp</code></li>
  
        <li><code>libhttpd.dsp</code></li>
  
        <li><code>Apache.dsp</code></li>
      </ol>
  
      <p>In addition, the <code>modules\</code> subdirectory tree contains
      project files for the majority of the modules.</p>
  
      <p>The <code>support\</code> directory contains project files for
      additional programs that are not part of the Apache runtime,
      but are used by the administrator to test Apache and maintain
      password and log files. Windows-specific support projects are
      broken out in the <code>support\win32\</code> directory.</p>
  
      <ol>
        <li><code>support\ab.dsp</code></li>
  
        <li><code>support\htdigest.dsp</code></li>
  
        <li><code>support\htpasswd.dsp</code></li>
  
        <li><code>support\logresolve.dsp</code></li>
  
        <li><code>support\rotatelogs.dsp</code></li>
  
        <li><code>support\win32\ApacheMonitor.dsp</code></li>
  
        <li><code>support\win32\wintty.dsp</code></li>
      </ol>
  
      <p>Once Apache has been compiled, it needs to be installed in
      its server root directory. The default is the
      <code>\Apache2</code> directory, of the same drive.</p>
  
      <p>To build and install all the files into the desired folder
      <em>dir</em> automatically, use one of the following
      <code>nmake</code> commands:</p>
  
      <example><pre>
  nmake /f Makefile.win installr INSTDIR=<em>dir</em>
  
  nmake /f Makefile.win installd INSTDIR=<em>dir</em>
      </pre></example>
  
      <p>The <em>dir</em> argument to <code>INSTDIR</code> gives
      the installation directory; it can be omitted if Apache is
      to be installed into <code>\Apache2</code>.</p>
  
      <p>This will install the following:</p>
  
      <ul>
        <li><code><em>dir</em>\bin\Apache.exe</code> - Apache
        executable</li>
  
        <li><code><em>dir</em>\bin\ApacheMonitor.exe</code> - Service
        monitor taskbar icon utility</li>
  
        <li><code><em>dir</em>\bin\htdigest.exe</code> - Digest auth
        password file utility</li>
  
        <li><code><em>dir</em>\bin\htdbm.exe</code> - SDBM auth
        database password file utility</li>
  
        <li><code><em>dir</em>\bin\htpasswd.exe</code> - Basic auth
        password file utility</li>
  
        <li><code><em>dir</em>\bin\logresolve.exe</code> - Log file
        dns name lookup utility</li>
  
        <li><code><em>dir</em>\bin\rotatelogs.exe</code> - Log file
        cycling utility</li>
  
        <li><code><em>dir</em>\bin\wintty.exe</code> - Console window
        utility</li>
  
        <li><code><em>dir</em>\bin\libapr.dll</code> - Apache
        Portable Runtime shared library</li>
  
        <li><code><em>dir</em>\bin\libaprutil.dll</code> - Apache
        Utility Runtime shared library</li>
  
        <li><code><em>dir</em>\bin\libhttpd.dll</code> - Apache Core
        library</li>
  
        <li><code><em>dir</em>\modules\mod_*.so</code> - Loadable
        Apache modules</li>
  
        <li><code><em>dir</em>\conf</code> - Configuration
        directory</li>
  
        <li><code><em>dir</em>\logs</code> - Empty logging
        directory</li>
  
        <li><code><em>dir</em>\include</code> - C language header
        files</li>
  
        <li><code><em>dir</em>\lib</code> - Link library files</li>
      </ul>
  
      <section id="projectcomponents-warn">
  
        <title>Warning about building Apache from the development tree</title>
  
        <note>Note only the <code>.dsp</code> files are maintained between <code>release</code>
        builds. The <code>.mak</code> files are NOT regenerated, due to the tremendous
        waste of reviewer's time. Therefore, you cannot rely on the <code>NMAKE</code>
        commands above to build revised <code>.dsp</code> project files unless you
        then export all <code>.mak</code> files yourself from the project. This is
        unnecessary if you build from within the Microsoft
        Developer Studio environment.</note>
  
        <note>Also note it is very worthwhile to build the <code>BuildBin</code>
        target project (or the command line <code>_apacher</code> or
        <code>_apached</code> target) prior to exporting the make files.
        Many files are autogenerated in the build process. Only a full
        build provides all of the dependent files required to build proper
        dependency trees for correct build behavior.</note>
  
        <p>In order to create distribution <code>.mak</code> files, always review
        the generated <code>.mak</code> (or <code>.dep</code>) dependencies for
        Platform SDK or other garbage includes. The <code>DevStudio\SharedIDE\bin\</code>
        (VC5) or <code>DevStudio\Common\MSDev98\bin\</code> (VC6) directory contains
        the <code>sysincl.dat</code> file, which must list all exceptions. Update this
        file (including both forward and backslashed paths, such as both
        <code>sys/time.h</code> and <code>sys\time.h</code>) to include such dependencies.
        Including local-install paths in a distributed <code>.mak</code> file will
        cause the build to fail completely. And don't forget to run
        <code>srclib/apr/build/fixwin32mak.pl</code> in order to fix absolute
        paths within the <code>.mak</code> files.</p>
  
      </section>
  
    </section>
  
  </manualpage>
  
  
  
  
  1.1                  httpd-2.0/docs/manual/platform/win_service.html.en
  
  Index: win_service.html.en
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                This file is generated from xml source: DO NOT EDIT
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        --><title>Running Apache for Windows as a Service - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body id="manual-page"><div id="page-header"><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><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.0</a></div><div id="page-content"><div id="preamble"><h1>Running Apache for Windows as a Service</h1>
  
      <p>Apache can be run as a service on Windows NT/2000. (There is
      also some HIGHLY EXPERIMENTAL support for similar behavior on
      <a href="#win95svc">Windows 95/98</a>, introduced with Apache
      1.3.13).</p>
  
      <p>Installing Apache as a service should only be done once you
      can successfully run it in a console window. See <a href="windows.html">Using Apache with Microsoft Windows</a>
      before you attempt to install or run Apache as a service.
      Changes to the <code>httpd.conf</code> file should always be
      followed by starting Apache as a console window. If this
      succeeds, the service should succeed.</p>
  
      <div class="note"><strong>Prior to version 1.3.13, the configuration was
      <em>not tested</em> prior to performing the
      installation</strong>, and a lack of service dependencies often
      caused the console window to succeed, but the service would
      still fail. See <a href="#service">below</a> if you are having
      problems running a version of Apache prior to 1.3.13 to resolve
      the issue. If you have this problem with version 1.3.13 or
      greater, first try uninstalling (<code>-u</code>) and re-installing
      (<code>-i</code>) the Apache service.</div>
  
      <p>To start Apache as a service, you first need to install it
      as a service. Multiple Apache services can be installed, each
      with a different name and configuration. To install the default
      Apache service named "Apache", run the "Install Apache as
      Service (NT only)" option from the Start menu. Once this is
      done you can start the "Apache" service by opening the Services
      window (in the Control Panel), selecting Apache, then clicking
      on Start. Apache will now be running, hidden in the background.
      You can later stop Apache by clicking on Stop. As an
      alternative to using the Services window, you can start and
      stop the "Apache" service from the command line with</p>
  
      <div class="example"><p><code>
        NET START APACHE<br />
        NET STOP APACHE
      </code></p></div>
  
      <p>See <a href="#signal">Controlling Apache as a Service</a>
      for more information on installing and controlling Apache
      services.</p>
  
      <div class="note"><h3>Note</h3>
      Apache, unlike many other Windows NT/2000 services,
      logs any errors to its own error.log file in the logs folder
      within the Apache server root folder. You will <em>not</em>
      find Apache error details in the Windows NT Event
      Log.</div>
  
      <p>After starting Apache as a service (or if you have trouble
      starting it) you can test it using the same <a href="windows.html#cmdline">procedure</a> as for running in a
      console window. Remember to use the command:</p>
  
      <div class="example"><p><code>
        apache -n "service name"
      </code></p></div>
  
      <p>to assure you are using the service's configuration.</p>
  
    </div><div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#service">Running Apache for Windows as a Service</a></li><li><img alt="" src="../images/down.gif" /> <a href="#depends">Important Note on service dependencies:</a></li><li><img alt="" src="../images/down.gif" /> <a href="#account">User Account for Apache Service to Run As (NT/2000)</a></li><li><img alt="" src="../images/down.gif" /> <a href="#trouble">Troubleshooting Apache for Windows as a Service</a></li><li><img alt="" src="../images/down.gif" /> <a href="#cmdline">Running Apache for Windows from the Command Line</a></li><li><img alt="" src="../images/down.gif" /> <a href="#signal">Controlling Apache as a Service</a></li><li><img alt="" src="../images/down.gif" /> <a href="#win95svc">HIGHLY EXPERIMENTAL Windows 95/98 Service</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="service" id="service">Running Apache for Windows as a Service</a></h2>
  
      
  
      <div class="note"><strong>The <code>-n</code> option to specify a service
      name is only available with Apache 1.3.7 and later.</strong>
      Earlier versions of Apache only support the default service name
      "Apache".</div>
  
      <p>You can install Apache as a Windows NT service as
      follows:</p>
  
      <div class="example"><p><code>
        apache -i -n "service name"
      </code></p></div>
  
      <p>To install a service to use a particular configuration,
      specify the configuration file when the service is
      installed:</p>
  
      <div class="example"><p><code>
        apache -i -n "service name" -f "\my server\conf\my.conf"
      </code></p></div>
  
      <p>To remove an Apache service, use:</p>
  
      <div class="example"><p><code>
        apache -u -n "service name"
      </code></p></div>
  
      <p>The default "service name", if one is not specified, is
      "Apache".</p>
  
      <p>Once a service is installed, you can use the <code>-n</code>
      option, in conjunction with other options, to refer to a
      service's configuration file. For example:</p>
  
      <p>To test a service's configuration file:</p>
  
      <div class="example"><p><code>
        apache -n "service name" -t
      </code></p></div>
  
      <p>To start a console Apache using a service's configuration
      file:</p>
  
      <div class="example"><p><code>
        apache -n "service name"
      </code></p></div>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="depends" id="depends">Important Note on service dependencies:</a></h2>
  
      
  
      <p>Prior to Apache release 1.3.13, the dependencies required to
      successfully start an installed service were not configured.
      After installing a service using earlier versions of Apache,
      you must follow these steps:</p>
  
      <div class="example"><p><code>
        Run regedt32 <br />
        Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu <br />
        Double-click to open the SYSTEM, then the CurrentControlSet keys <br />
        Scroll down and click on the Apache servicename <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        ����Value Name: DependOnGroup <br />
        ����Data Type: REG_MULTI_SZ <br />
        ����and click OK <br />
        Leave the Multi-String Editor dialog empty and click OK <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        ����Value Name: DependOnService <br />
        ����Data Type: REG_MULTI_SZ <br />
        ����and click OK <br />
        Type the following list (one per line) in the Multi-String Editor dialog <br />
        ����Tcpip <br />
        ����Afd <br />
        ����and click OK <br />
      </code></p></div>
  
      <p>If you are using COM or DCOM components from a third party
      module, ISAPI, or other add-in scripting technologies such as
      ActiveState Perl, you may also need to add the entry Rpcss to
      the DependOnService list. To avoid exposing the TCP port 135
      when it is unnecessary, Apache does not create that entry upon
      installation. Follow the directions above to find or create the
      DependOnService value, double click that value if it already
      exists, and add the Rpcss entry to the list.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="account" id="account">User Account for Apache Service to Run As (NT/2000)</a></h2>
  
      
  
      <p>When Apache is first installed as a service (e.g. with the
      <code>-i</code> option) it will run as user "System" (the LocalSystem
      account). There should be few issues if all resources for the
      web server reside on the local system, but it has broad
      security privileges to affect the local machine!</p>
  
      <div class="note">LocalSystem is a very privileged account locally, so you
      shouldn't run any shareware applications there. However, it
      has no network privileges and cannot leave the machine via
      any NT-secured mechanism, including file system, named pipes,
      DCOM, or secure RPC.</div>
  
      <p><strong>NEVER grant network privileges to the SYSTEM
      account!</strong> Create a new user account instead, grant the
      appropriate privileges to that user, and use the the "Log On
      As:" option. Select the Start Menu -&gt; Settings -&gt; Control
      Panel -&gt; Services -&gt; apache service ... and click the
      "Startup" button to access this setting.</p>
  
      <div class="note">A service that runs in the context of the LocalSystem account
      inherits the security context of the SCM. It is not
      associated with any logged-on user account and does not have
      credentials (domain name, user name, and password) to be used
      for verification.</div>
  
      <p>The SYSTEM account has no privileges to the network, so
      shared pages or a shared installation of Apache is invisible to
      the service. If you intend to use <em>any</em> network
      resources, the following steps should help:</p>
  
      <ul>
        <li>Select Apache from the Control Panel's Service dialog and
        click Startup.</li>
  
        <li>Verify that the service account is correct. You may wish
        to create an account for your Apache services.</li>
  
        <li>Retype the password and password confirmation.</li>
  
        <li>Go to User Manager for Domains.</li>
  
        <li>Click on Policies from the title bar menu, and select
        User Rights.</li>
  
        <li>Select the option for Advanced User Rights.</li>
  
        <li>
          In the drop-down list, verify that the following rights
          have been granted to the selected account:
  
          <ul>
            <li>Act as part of the operating system</li>
  
            <li>Back up files and directories</li>
  
            <li>Log on as a service</li>
  
            <li>Restore files and directories</li>
          </ul>
        </li>
  
        <li>Confirm that the selected account is a member of the
        Users group.</li>
  
        <li>Confirm the selected account has access to all
        <code>document</code> and <code>script</code>
        directories (minimally read and browse access).</li>
  
        <li>Confirm the selected account has read/write/delete access
        to the Apache <code>logs</code> directory!</li>
      </ul>
  
      <p>If you allow the account to log in as a user, then you can
      log in yourself and test that the account has the privileges to
      execute the scripts, read the web pages, and that you can start
      Apache in a console window. If this works, and you have
      followed the steps above, Apache should execute as a service
      with no problems.</p>
  
      <div class="note"><strong>Error code 2186</strong> is a good indication
      that you need to review the "Log On As" configuration, since
      the server can't access a required network resource.</div>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="trouble" id="trouble">Troubleshooting Apache for Windows as a Service</a></h2>
  
      
  
      <p>When starting Apache as a service you may encounter an error
      message from Windows service manager. For example if you try to
      start Apache using the Services applet in Windows Control Panel
      you may get the following message:</p>
  
      <div class="example"><p><code>
        Could not start the apache service on \\COMPUTER <br />
        Error 1067; The process terminated unexpectedly.
      </code></p></div>
  
      <p>You will get this error if there is any problem starting
      Apache. In order to see what is causing the problem you should
      follow the instructions for <a href="windows.html#cmdline">Running Apache for Windows from the
      Command Line</a>.</p>
  
      <p>Also, Apache 1.3.13 now records startup errors in the
      Application Event Log under Windows NT/2000, if Apache is run
      as a service. Run the Event Viewer and select Log ...
      Application to see these events.</p>
  
      <div class="note"><strong>Check the Application Event Log with the Event
      Viewer in case of any problems, even if no error message pops
      up to warn you that an error occured.</strong></div>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="cmdline" id="cmdline">Running Apache for Windows from the Command Line</a></h2>
  
      
  
      <p>For details on controlling Apache service from the command
      line, please refer to <a href="windows.html#cmdline">console
      command line</a> section.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="signal" id="signal">Controlling Apache as a Service</a></h2>
  
      
  
      <p>Multiple instances of Apache can be installed and run as
      services. Signal an installed Apache service to start, restart,
      or shutdown/stop as follows:</p>
  
      <div class="example"><p><code>
        apache -n "service name" -k start <br />
        apache -n "service name" -k restart <br />
        apache -n "service name" -k shutdown <br />
        apache -n "service name" -k stop
      </code></p></div>
  
      <p>For the default "Apache" service, the <code>-n</code> Apache
      option is still required, since the <code>-k</code> commands without
      the <code>-n</code> option are directed at Apache running in a console
      window. The quotes are only required if the service name contains spaces.</p>
  
      <div class="note"><strong>Note the <code>-k stop</code> alias for the
      <code>-k shutdown</code> command was introduced in Apache version
      1.3.13.</strong> Earlier versions of Apache will only recognize the
      <code>-k shutdown</code> option. Prior to 1.3.3, Apache did not
      recognize <em>any</em> <code>-k</code> options at all!</div>
  
      <p>In addition, you can use the native NT <code>NET</code> command
      to start and stop Apache services as follows:</p>
  
      <div class="example"><p><code>
        NET START "service name" <br />
        NET STOP "service name"
      </code></p></div>
  
      <p>Again, quotes are only required if the service name contains
      spaces.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="win95svc" id="win95svc">HIGHLY EXPERIMENTAL Windows 95/98 Service</a></h2>
  
      
  
      <div class="note"><strong>The service options for Windows 95 and 98 are
      only available with Apache 1.3.13 and later.</strong> Earlier
      versions of Apache only supported Apache in a console window
      for Windows 95/98.</div>
  
      <p>There is some support for Apache on Windows 95/98 to behave
      in a similar manner as a service on Windows NT/2000. It is
      <em>highly experimental</em>, if it works (at all) the Apache
      Sofware Foundation will not attest to its reliability or
      future support. Proceed at your own risk!</p>
  
      <p>Once you have confirmed that Apache runs correctly at the <a href="windows.html#cmdline">Command Prompt</a> you can install,
      control and uninstall it with the same commands as the Windows
      NT/2000 version.</p>
  
      <p>There are, however, significant differences that you should
      note:</p>
  
      <p>Apache will attempt to start and if successful it will run
      in the background. If you run the command</p>
  
      <div class="example"><p><code>
        Apache -n "service name" -k start
      </code></p></div>
  
      <p>via a shortcut on your desktop, for example, then if the
      service starts successfully a console window will flash up but
      immediately disappears. If Apache detects any errors on startup
      such as a incorrect entries in the <code>httpd.conf</code> file,
      then the console window will remain visible. This will display
      an error message which will be useful in tracking down the cause
      of the problem.</p>
  
      <p>Windows 95/98 does not support <code>NET START</code> or
      <code>NET STOP</code> commands so you must use Apache's Service
      Control options at a command prompt. You may wish to set up a
      shortcut for each of these commands so that you can just choose
      it from the start menu or desktop to perform the required action.</p>
  
      <p>Apache and Windows 95/98 offer no support for running the
      Apache service as a specific user with network privileges. In
      fact, Windows 95/98 offers no security on the local machine,
      either. This is the simple reason that the Apache Software
      Foundation never endorses the use of Windows 95/98 as a public
      httpd server. These facilities exist only to assist the user in
      developing web content and learning the Apache server, and
      perhaps as a intranet server on a secured, private network.</p>
  
    </div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</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></body></html>
  
  
  1.1                  httpd-2.0/docs/manual/platform/win_service.xml
  
  Index: win_service.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
  <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
  
  <manualpage>
    <relativepath href=".." />
  
    <title>Running Apache for Windows as a Service</title>
  
    <summary>
  
      <p>Apache can be run as a service on Windows NT/2000. (There is
      also some HIGHLY EXPERIMENTAL support for similar behavior on
      <a href="#win95svc">Windows 95/98</a>, introduced with Apache
      1.3.13).</p>
  
      <p>Installing Apache as a service should only be done once you
      can successfully run it in a console window. See <a
      href="windows.html">Using Apache with Microsoft Windows</a>
      before you attempt to install or run Apache as a service.
      Changes to the <code>httpd.conf</code> file should always be
      followed by starting Apache as a console window. If this
      succeeds, the service should succeed.</p>
  
      <note><strong>Prior to version 1.3.13, the configuration was
      <em>not tested</em> prior to performing the
      installation</strong>, and a lack of service dependencies often
      caused the console window to succeed, but the service would
      still fail. See <a href="#service">below</a> if you are having
      problems running a version of Apache prior to 1.3.13 to resolve
      the issue. If you have this problem with version 1.3.13 or
      greater, first try uninstalling (<code>-u</code>) and re-installing
      (<code>-i</code>) the Apache service.</note>
  
      <p>To start Apache as a service, you first need to install it
      as a service. Multiple Apache services can be installed, each
      with a different name and configuration. To install the default
      Apache service named "Apache", run the "Install Apache as
      Service (NT only)" option from the Start menu. Once this is
      done you can start the "Apache" service by opening the Services
      window (in the Control Panel), selecting Apache, then clicking
      on Start. Apache will now be running, hidden in the background.
      You can later stop Apache by clicking on Stop. As an
      alternative to using the Services window, you can start and
      stop the "Apache" service from the command line with</p>
  
      <example>
        NET START APACHE<br />
        NET STOP APACHE
      </example>
  
      <p>See <a href="#signal">Controlling Apache as a Service</a>
      for more information on installing and controlling Apache
      services.</p>
  
      <note><title>Note</title>
      Apache, unlike many other Windows NT/2000 services,
      logs any errors to its own error.log file in the logs folder
      within the Apache server root folder. You will <em>not</em>
      find Apache error details in the Windows NT Event
      Log.</note>
  
      <p>After starting Apache as a service (or if you have trouble
      starting it) you can test it using the same <a
      href="windows.html#cmdline">procedure</a> as for running in a
      console window. Remember to use the command:</p>
  
      <example>
        apache -n "service name"
      </example>
  
      <p>to assure you are using the service's configuration.</p>
  
    </summary>
  
    <section id="service">
  
      <title>Running Apache for Windows as a Service</title>
  
      <note><strong>The <code>-n</code> option to specify a service
      name is only available with Apache 1.3.7 and later.</strong>
      Earlier versions of Apache only support the default service name
      "Apache".</note>
  
      <p>You can install Apache as a Windows NT service as
      follows:</p>
  
      <example>
        apache -i -n "service name"
      </example>
  
      <p>To install a service to use a particular configuration,
      specify the configuration file when the service is
      installed:</p>
  
      <example>
        apache -i -n "service name" -f "\my server\conf\my.conf"
      </example>
  
      <p>To remove an Apache service, use:</p>
  
      <example>
        apache -u -n "service name"
      </example>
  
      <p>The default "service name", if one is not specified, is
      "Apache".</p>
  
      <p>Once a service is installed, you can use the <code>-n</code>
      option, in conjunction with other options, to refer to a
      service's configuration file. For example:</p>
  
      <p>To test a service's configuration file:</p>
  
      <example>
        apache -n "service name" -t
      </example>
  
      <p>To start a console Apache using a service's configuration
      file:</p>
  
      <example>
        apache -n "service name"
      </example>
  
    </section>
  
    <section id="depends">
  
      <title>Important Note on service dependencies:</title>
  
      <p>Prior to Apache release 1.3.13, the dependencies required to
      successfully start an installed service were not configured.
      After installing a service using earlier versions of Apache,
      you must follow these steps:</p>
  
      <example>
        Run regedt32 <br />
        Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu <br />
        Double-click to open the SYSTEM, then the CurrentControlSet keys <br />
        Scroll down and click on the Apache servicename <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        &#160;&#160;&#160;&#160;Value Name: DependOnGroup <br />
        &#160;&#160;&#160;&#160;Data Type: REG_MULTI_SZ <br />
        &#160;&#160;&#160;&#160;and click OK <br />
        Leave the Multi-String Editor dialog empty and click OK <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        &#160;&#160;&#160;&#160;Value Name: DependOnService <br />
        &#160;&#160;&#160;&#160;Data Type: REG_MULTI_SZ <br />
        &#160;&#160;&#160;&#160;and click OK <br />
        Type the following list (one per line) in the Multi-String Editor dialog <br />
        &#160;&#160;&#160;&#160;Tcpip <br />
        &#160;&#160;&#160;&#160;Afd <br />
        &#160;&#160;&#160;&#160;and click OK <br />
      </example>
  
      <p>If you are using COM or DCOM components from a third party
      module, ISAPI, or other add-in scripting technologies such as
      ActiveState Perl, you may also need to add the entry Rpcss to
      the DependOnService list. To avoid exposing the TCP port 135
      when it is unnecessary, Apache does not create that entry upon
      installation. Follow the directions above to find or create the
      DependOnService value, double click that value if it already
      exists, and add the Rpcss entry to the list.</p>
  
    </section>
  
    <section id="account">
  
      <title>User Account for Apache Service to Run As (NT/2000)</title>
  
      <p>When Apache is first installed as a service (e.g. with the
      <code>-i</code> option) it will run as user "System" (the LocalSystem
      account). There should be few issues if all resources for the
      web server reside on the local system, but it has broad
      security privileges to affect the local machine!</p>
  
      <note>LocalSystem is a very privileged account locally, so you
      shouldn't run any shareware applications there. However, it
      has no network privileges and cannot leave the machine via
      any NT-secured mechanism, including file system, named pipes,
      DCOM, or secure RPC.</note>
  
      <p><strong>NEVER grant network privileges to the SYSTEM
      account!</strong> Create a new user account instead, grant the
      appropriate privileges to that user, and use the the "Log On
      As:" option. Select the Start Menu -&gt; Settings -&gt; Control
      Panel -&gt; Services -&gt; apache service ... and click the
      "Startup" button to access this setting.</p>
  
      <note>A service that runs in the context of the LocalSystem account
      inherits the security context of the SCM. It is not
      associated with any logged-on user account and does not have
      credentials (domain name, user name, and password) to be used
      for verification.</note>
  
      <p>The SYSTEM account has no privileges to the network, so
      shared pages or a shared installation of Apache is invisible to
      the service. If you intend to use <em>any</em> network
      resources, the following steps should help:</p>
  
      <ul>
        <li>Select Apache from the Control Panel's Service dialog and
        click Startup.</li>
  
        <li>Verify that the service account is correct. You may wish
        to create an account for your Apache services.</li>
  
        <li>Retype the password and password confirmation.</li>
  
        <li>Go to User Manager for Domains.</li>
  
        <li>Click on Policies from the title bar menu, and select
        User Rights.</li>
  
        <li>Select the option for Advanced User Rights.</li>
  
        <li>
          In the drop-down list, verify that the following rights
          have been granted to the selected account:
  
          <ul>
            <li>Act as part of the operating system</li>
  
            <li>Back up files and directories</li>
  
            <li>Log on as a service</li>
  
            <li>Restore files and directories</li>
          </ul>
        </li>
  
        <li>Confirm that the selected account is a member of the
        Users group.</li>
  
        <li>Confirm the selected account has access to all
        <code>document</code> and <code>script</code>
        directories (minimally read and browse access).</li>
  
        <li>Confirm the selected account has read/write/delete access
        to the Apache <code>logs</code> directory!</li>
      </ul>
  
      <p>If you allow the account to log in as a user, then you can
      log in yourself and test that the account has the privileges to
      execute the scripts, read the web pages, and that you can start
      Apache in a console window. If this works, and you have
      followed the steps above, Apache should execute as a service
      with no problems.</p>
  
      <note><strong>Error code 2186</strong> is a good indication
      that you need to review the "Log On As" configuration, since
      the server can't access a required network resource.</note>
  
    </section>
  
    <section id="trouble">
  
      <title>Troubleshooting Apache for Windows as a Service</title>
  
      <p>When starting Apache as a service you may encounter an error
      message from Windows service manager. For example if you try to
      start Apache using the Services applet in Windows Control Panel
      you may get the following message:</p>
  
      <example>
        Could not start the apache service on \\COMPUTER <br />
        Error 1067; The process terminated unexpectedly.
      </example>
  
      <p>You will get this error if there is any problem starting
      Apache. In order to see what is causing the problem you should
      follow the instructions for <a
      href="windows.html#cmdline">Running Apache for Windows from the
      Command Line</a>.</p>
  
      <p>Also, Apache 1.3.13 now records startup errors in the
      Application Event Log under Windows NT/2000, if Apache is run
      as a service. Run the Event Viewer and select Log ...
      Application to see these events.</p>
  
      <note><strong>Check the Application Event Log with the Event
      Viewer in case of any problems, even if no error message pops
      up to warn you that an error occured.</strong></note>
  
    </section>
  
    <section id="cmdline">
  
      <title>Running Apache for Windows from the Command Line</title>
  
      <p>For details on controlling Apache service from the command
      line, please refer to <a href="windows.html#cmdline">console
      command line</a> section.</p>
  
    </section>
  
    <section id="signal">
  
      <title>Controlling Apache as a Service</title>
  
      <p>Multiple instances of Apache can be installed and run as
      services. Signal an installed Apache service to start, restart,
      or shutdown/stop as follows:</p>
  
      <example>
        apache -n "service name" -k start <br />
        apache -n "service name" -k restart <br />
        apache -n "service name" -k shutdown <br />
        apache -n "service name" -k stop
      </example>
  
      <p>For the default "Apache" service, the <code>-n</code> Apache
      option is still required, since the <code>-k</code> commands without
      the <code>-n</code> option are directed at Apache running in a console
      window. The quotes are only required if the service name contains spaces.</p>
  
      <note><strong>Note the <code>-k stop</code> alias for the
      <code>-k shutdown</code> command was introduced in Apache version
      1.3.13.</strong> Earlier versions of Apache will only recognize the
      <code>-k shutdown</code> option. Prior to 1.3.3, Apache did not
      recognize <em>any</em> <code>-k</code> options at all!</note>
  
      <p>In addition, you can use the native NT <code>NET</code> command
      to start and stop Apache services as follows:</p>
  
      <example>
        NET START "service name" <br />
        NET STOP "service name"
      </example>
  
      <p>Again, quotes are only required if the service name contains
      spaces.</p>
  
    </section>
  
    <section id="win95svc">
  
      <title>HIGHLY EXPERIMENTAL Windows 95/98 Service</title>
  
      <note><strong>The service options for Windows 95 and 98 are
      only available with Apache 1.3.13 and later.</strong> Earlier
      versions of Apache only supported Apache in a console window
      for Windows 95/98.</note>
  
      <p>There is some support for Apache on Windows 95/98 to behave
      in a similar manner as a service on Windows NT/2000. It is
      <em>highly experimental</em>, if it works (at all) the Apache
      Sofware Foundation will not attest to its reliability or
      future support. Proceed at your own risk!</p>
  
      <p>Once you have confirmed that Apache runs correctly at the <a
      href="windows.html#cmdline">Command Prompt</a> you can install,
      control and uninstall it with the same commands as the Windows
      NT/2000 version.</p>
  
      <p>There are, however, significant differences that you should
      note:</p>
  
      <p>Apache will attempt to start and if successful it will run
      in the background. If you run the command</p>
  
      <example>
        Apache -n "service name" -k start
      </example>
  
      <p>via a shortcut on your desktop, for example, then if the
      service starts successfully a console window will flash up but
      immediately disappears. If Apache detects any errors on startup
      such as a incorrect entries in the <code>httpd.conf</code> file,
      then the console window will remain visible. This will display
      an error message which will be useful in tracking down the cause
      of the problem.</p>
  
      <p>Windows 95/98 does not support <code>NET START</code> or
      <code>NET STOP</code> commands so you must use Apache's Service
      Control options at a command prompt. You may wish to set up a
      shortcut for each of these commands so that you can just choose
      it from the start menu or desktop to perform the required action.</p>
  
      <p>Apache and Windows 95/98 offer no support for running the
      Apache service as a specific user with network privileges. In
      fact, Windows 95/98 offers no security on the local machine,
      either. This is the simple reason that the Apache Software
      Foundation never endorses the use of Windows 95/98 as a public
      httpd server. These facilities exist only to assist the user in
      developing web content and learning the Apache server, and
      perhaps as a intranet server on a secured, private network.</p>
  
    </section>
  
  </manualpage>
  
  
  
  
  1.1                  httpd-2.0/docs/manual/platform/windows.html.en
  
  Index: windows.html.en
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                This file is generated from xml source: DO NOT EDIT
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        --><title>Using Apache with Microsoft Windows - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body id="manual-page"><div id="page-header"><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><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.0</a></div><div id="page-content"><div id="preamble"><h1>Using Apache with Microsoft Windows</h1>
  
      <p>This document explains how to install, configure and run
      Apache 2.0 under Microsoft Windows. If you find any bugs, or
      wish to contribute in other ways, please use our <a href="http://httpd.apache.org/bug_report.html">bug reporting page.</a></p>
  
      <p>Most of this document assumes that you are installing
      Windows from a binary distribution. If you want to compile
      Apache yourself (possibly to help with development, or to track
      down bugs), see <a href="win_compiling.html">Compiling Apache
      for Microsoft Windows</a>.</p>
  
      <p><strong>At this time, support for Windows 95, 98 and ME is
      incomplete. Apache 2.0 is not expected to work on those
      platforms at this time.</strong> If you are interested in
      helping with that effort, please see the developer's site for
      information on <a href="http://dev.apache.org/">how to get
      involved</a>. Support will likely be provided at some point in
      the future, and patches to allow Apache to work on 95, 98 and
      ME are welcome!</p>
  
    </div><div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#req">Requirements</a></li><li><img alt="" src="../images/down.gif" /> <a href="#down">Downloading Apache for Windows</a></li><li><img alt="" src="../images/down.gif" /> <a href="#inst">Installing Apache for Windows</a></li><li><img alt="" src="../images/down.gif" /> <a href="#run">Running Apache for Windows</a></li><li><img alt="" src="../images/down.gif" /> <a href="#use">Configuring Apache for Windows</a></li><li><img alt="" src="../images/down.gif" /> <a href="#service">Running Apache for Windows as a Service</a></li><li><img alt="" src="../images/down.gif" /> <a href="#cmdline">Running Apache for Windows from the Command Line</a></li><li><img alt="" src="../images/down.gif" /> <a href="#signalsrv">Signalling Service Apache when running</a></li><li><img alt="" src="../images/down.gif" /> <a href="#signal">Signalling Console Apache when running</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="req" id="req">Requirements</a></h2>
  
      
  
      <p>Apache 2.0 is designed to run on Windows NT 4.0 and Windows
      2000. The binary installer will only work with the x86 family
      of processors, such as Intel's. Apache may also run on Windows
      95, 98 and ME, but these are not tested, and are never
      recommended for production servers. In all cases TCP/IP
      networking must be installed.</p>
  
      <p>If running on Windows 95, the "Winsock2" upgrade MUST BE
      INSTALLED. "Winsock2" for Windows 95 is available <a href="http://www.microsoft.com/windows95/downloads/">here</a>.</p>
  
      <p>If running on NT 4.0, installing Service Pack 3 or 6 is
      recommended, as Service Pack 4 created known issues with TCP/IP
      and WinSock integrity that were resolved in later Service
      Packs.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="down" id="down">Downloading Apache for Windows</a></h2>
  
      
  
      <p>Information on the latest version of Apache can be found on
      the Apache web server at <a href="http://httpd.apache.org/">http://httpd.apache.org/</a>.
      This will list the current release, any more recent alpha or
      beta-test releases, together with details of mirror web and
      anonymous ftp sites.</p>
  
      <p>You should download the version of Apache for Windows with
      the <code>.msi</code> extension. This is a single Microsoft
      Installer file containing Apache, ready to install and run.
      There is a seperate <code>.zip</code> file containing <em>only</em>
      the source code, to compile Apache yourself with the Microsoft
      Visual C++ (Visual Studio) tools.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="inst" id="inst">Installing Apache for Windows</a></h2>
  
      
  
      <p>Run the Apache <code>.msi</code> file you downloaded above.
      This will ask for:</p>
  
      <ul>
        <li>the directory to install Apache into (the default is
        <code>\Program Files\Apache Group\Apache</code> although you
        can change this to any other directory)</li>
  
        <li>the start menu name (default is "Apache Web Server")</li>
  
        <li>the installation type. The "Typical" option installs
        everything except the source code. The "Minimum" option does
        not install the manuals or source code. Choose the "Custom"
        install if you want to install the source code.</li>
      </ul>
  
      <p>During the installation, Apache will configure the files in
      the <code>conf</code> directory for your chosen installation
      directory. However if any of the files in this directory
      already exist they will <em>not</em> be overwritten.
      Instead the new copy of the corresponding file will be left
      with the extension <code>.default</code>. So, for example, if
      <code>conf\httpd.conf</code> already exists it will not be
      altered, but the version which would have been installed will
      be left in <code>conf\httpd.conf.default</code>. After the
      installation has finished you should manually check to see what is
      in new in the <code>.default</code> file, and if necessary
      update your existing configuration files.</p>
  
      <p>Also, if you already have a file called
      <code>htdocs\index.html</code> then it will not be overwritten
      (no <code>index.html.default</code> file will be installed
      either). This should mean it a safe to install Apache over an
      existing installation (but you will have to stop the existing
      server running before doing the installation, then start the
      new one after the installation is finished).</p>
  
      <p>After installing Apache, you should edit the configuration
      files in the <code>conf</code> directory as required. These
      files will be configured during the install ready for Apache to
      be run from the directory where it was installed, with the
      documents served from the subdirectory <code>htdocs</code>.
      There are lots of other options which should be set before you
      start really using Apache. However to get started quickly the
      files should work as installed.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="run" id="run">Running Apache for Windows</a></h2>
  
      
  
      <p>There are two ways you can run Apache:</p>
  
      <ul>
        <li><p>As a <a href="win_service.html#service">"service"</a>
        (available on Windows NT/2000, or a pseudo-service on Windows
        95, 98 or ME). This is the best option if you want Apache to
        automatically start when you machine boots, and to keep
        Apache running when you log-off.</p></li>
  
        <li><p>From a <a href="#cmdline">console window</a>. This MUST
        be used by any administrator to test before to attempting to
        run as a service.</p></li>
      </ul>
  
      <p>To run Apache from a console window, select the "Start
      Apache as console app" option from the Start menu (in Apache
      1.3.4 and earlier, this option was called "Apache Server").
      This will open a console window and start Apache running inside
      it. The window will remain active until you stop Apache. To
      stop Apache running, either select the "Shutdown Apache console
      app" icon option from the Start menu (this is not available in
      Apache 1.3.4 or earlier), or see <a href="#signal">Signalling
      Console Apache when Running</a> for how to control Apache from
      the command line.</p>
  
      <p>If the Apache console window closes immediately (or
      unexpectedly), run the "Command Prompt" from the Start Menu -
      Programs list. Change to the folder to which you installed
      Apache, type the command apache, and read the error message.
      Then change to the <code>logs</code> folder, and review the
      <code>error.log</code> file for configuration mistakes.
      If you accepted the defaults when you installed Apache,
      the commands would be:</p>
  
      <div class="example"><p><code>
        c: <br />
        cd "\program files\apache group\apache" <br />
        apache <br />
        Wait for Apache to exit, or press Ctrl+C <br />
        cd logs <br />
        more &lt;error.log
      </code></p></div>
  
      <p><strong>Complete the steps above before you proceed
      to attempt to start Apache as a Window NT/2000
      service!</strong></p>
  
      <p>To start Apache as a service, you first need to install it
      as a service. Multiple Apache services can be installed, each
      with a different name and configuration. To install the default
      Apache service named "Apache", run the "Install Apache as
      Service (NT only)" option from the Start menu. Once this is
      done you can start the "Apache" service by opening the Services
      window (in the Control Panel), selecting Apache, then clicking
      on Start. Apache will now be running in the background. You can
      later stop Apache by clicking on Stop. As an alternative to
      using the Services window, you can start and stop the "Apache"
      service from the control line with:</p>
  
      <div class="example"><p><code>
        NET START APACHE <br />
        NET STOP APACHE
      </code></p></div>
  
      <p>See <a href="#signalsrv">Signalling Service Apache when
      Running</a> for more information on installing and controlling
      Apache services.</p>
  
      <div class="note"><strong>Apache, unlike many other Windows NT/2000 services,
      logs any errors to its own <code>error.log</code> file in the
      <code>logs</code> folder within the Apache server root folder.
      You will <em>not</em> find Apache error details in the Windows
      NT Event Log.</strong></div>
  
      <p>After starting Apache running (either in a console window or
      as a service) it will be listening to port 80 (unless you
      changed the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive in the configuration
      files). To connect to the server and access the default page,
      launch a browser and enter this URL:</p>
  
      <div class="example"><p><code>
        http://localhost/
      </code></p></div>
  
      <p>This should respond with a welcome page, and a link to the
      Apache manual. If nothing happens or you get an error, look in
      the <code>error_log</code> file in the <code>logs</code>
      directory. If your host isn't connected to the net, you may
      have to use this URL:</p>
  
      <div class="example"><p><code>
        http://127.0.0.1/
      </code></p></div>
  
      <p>Once your basic installation is working, you should
      configure it properly by editing the files in the
      <code>conf</code> directory. Again, if you change the
      configuration of the Windows NT/2000 service for Apache, first
      attempt to start it from the command line to assure that the
      service starts with no errors.</p>
  
      <p>Because Apache <em>CANNOT</em> share the same port with
      another TCPIP application, you may need to stop or uninstall
      certain services first. These include (but are not limited to)
      other web servers, and firewall products such as BlackIce. If
      you can only start Apache with these services disabled,
      reconfigure either Apache or the other product so that they do
      not listen on the same TCPIP ports.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="use" id="use">Configuring Apache for Windows</a></h2>
  
      
  
      <p>Apache is configured by files in the <code>conf</code>
      directory. These are the same as files used to configure the
      Unix version, but there are a few different directives for
      Apache on Windows. See the <a href="../">Apache
      documentation</a> for all the available directives.</p>
  
      <p>The main differences in Apache for Windows are:</p>
  
      <ul>
        <li>
          <p>Because Apache for Windows is multithreaded, it does not
          use a separate process for each request, as Apache does
          with Unix. Instead there are usually only two Apache
          processes running: a parent process, and a child which
          handles the requests. Within the child each request is
          handled by a separate thread.</p>
  
          <p>So the "process"-management directives are
          different:</p>
  
          <p><code class="directive"><a href="../mod/mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></code>
          - Like the Unix directive, this controls how many requests
          a process will serve before exiting. However, unlike Unix,
          a process serves all the requests at once, not just one, so
          if this is set, it is recommended that a very high number
          is used. The recommended default, <code>MaxRequestsPerChild
          0</code>, does not cause the process to ever exit.</p>
          
          <div class="warning"><strong>Warning: The server configuration
          file is reread when the new child process is started. If you
          have modified <code>httpd.conf</code>, the new child may not
          start or you may receive unexpected results.</strong></div>
  
          <p><code class="directive"><a href="../mod/mpm_common.html#threadsperchild">ThreadsPerChild</a></code>
          - This directive is new, and tells the server how many
          threads it should use. This is the maximum number of
          connections the server can handle at once; be sure and set
          this number high enough for your site if you get a lot of
          hits. The recommended default is <code>ThreadsPerChild
          50</code>.</p>
        </li>
  
        <li>
          <p>The directives that accept filenames as arguments now
          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.</p>
        </li>
  
        <li>
          <p>Apache for Windows contains the ability to load modules
          at runtime, without recompiling the server. If Apache is
          compiled normally, it will install a number of optional
          modules in the <code>\Apache\modules</code> directory. To
          activate these, or other modules, the new <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>
          directive must be used. For example, to active the status
          module, use the following (in addition to the
          status-activating directives in
          <code>access.conf</code>):</p>
  
          <div class="example"><p><code>
            LoadModule status_module modules/mod_status.so
          </code></p></div>
  
          <p>Information on <a href="../mod/mod_so.html#creating">creating loadable
          modules</a> is also available.</p>
        </li>
  
        <li>
          <p>Apache can also load ISAPI Extensions (<em>i.e.</em>,
          Internet Server Applications), such as those used by
          Microsoft's IIS, and other Windows servers. <a href="../mod/mod_isapi.html">More information is
          available.</a> Note that Apache <em>CANNOT</em> load ISAPI
          Filters.</p>
        </li>
  
        <li>
          <p>When running CGI scripts, the method Apache uses to find
          the interpreter for the script is configurable using the
          <code class="directive"><a href="../mod/mod_core.html#scriptinterpretersource">ScriptInterpreterSource</a></code>
          directive.</p>
        </li>
  
        <li>
          <p>Since it is often difficult to manage files with names
          like <code>.htaccess</code> under windows, you may find it
          useful to change the name of this configuration file using
          the <code class="directive"><a href="../mod/mod_core.html#accessfilename">AccessFilename</a></code>
          directive.</p>
        </li>
      </ul>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="service" id="service">Running Apache for Windows as a Service</a></h2>
  
      
  
      <div class="note"><strong>The <code>-n</code> option to specify a service name
      is only available with Apache 1.3.7 and later. Earlier versions of
      Apache only support the default service name
      "Apache".</strong></div>
  
      <p>You can install Apache as a Windows NT service as
      follows:</p>
  
      <div class="example"><p><code>
        apache -k install -n "service name"
      </code></p></div>
  
      <p>To install a service to use a particular configuration,
      specify the configuration file when the service is
      installed:</p>
  
      <div class="example"><p><code>
        apache -k install -n "service name" -f "\my server\conf\my.conf"
      </code></p></div>
  
      <p>To remove an Apache service, use</p>
  
      <div class="example"><p><code>
        apache -k uninstall -n "service name"
      </code></p></div>
  
      <p>The default "service name", if one is not specified, is
      "Apache".</p>
  
      <p>Once a service is installed, you can use the <code>-n</code>
      option, in conjunction with other options, to refer to a
      service's configuration file. For example:</p>
  
      <p>To test a service's configuration file:</p>
  
      <div class="example"><p><code>
        apache -n "service name" -t
      </code></p></div>
  
      <p>To start a console Apache using a service's configuration
      file:</p>
  
      <div class="example"><p><code>
        apache -n "service name"
      </code></p></div>
  
      <p><strong>Important Note on service dependencies:</strong></p>
  
      <p>Prior to Apache release 1.3.13, the dependencies required to
      successfully start an installed service were not configured.
      After installing a service using earlier versions of Apache,
      you must follow these steps:</p>
  
      <div class="example"><p><code>
        Run regedt32 <br />
        Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu <br />
        Double-click to open the SYSTEM, then the CurrentControlSet keys <br />
        Scroll down and click on the Apache servicename <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        ����Value Name: DependOnGroup <br />
        ����Data Type: REG_MULTI_SZ <br />
        ����and click OK <br />
        Leave the Multi-String Editor dialog empty and click OK <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        ����Value Name: DependOnService <br />
        ����Data Type: REG_MULTI_SZ <br />
        ����and click OK <br />
        Type the following list (one per line) in the Multi-String Editor dialog <br />
        ����Tcpip <br />
        ����Afd <br />
        ����and click OK
      </code></p></div>
  
      <p>If you are using COM or DCOM components from a third party
      module, ISAPI, or other add-in scripting technologies such as
      ActiveState Perl, you may also need to add the entry Rpcss to
      the DependOnService list. To avoid exposing the TCP port 135
      when it is unnecessary, Apache does not create that entry upon
      installation. Follow the directions above to find or create the
      DependOnService value, double click that value if it already
      exists, and add the Rpcss entry to the list.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="cmdline" id="cmdline">Running Apache for Windows from the Command Line</a></h2>
  
      
  
      <p>The Start menu icons and the NT Service manager can provide
      a simple interface for administering Apache. But in some cases
      it is easier to work from the command line.</p>
  
      <p>When working with Apache it is important to know how it will
      find the configuration files. You can specify a configuration
      file on the command line in two ways:</p>
  
      <ul>
        <li><code>-f</code> specifies a path to a particular
        configuration file</li>
      </ul>
  
      <div class="example"><p><code>
        apache -f "c:\my server\conf\my.conf" <br />
        apache -f test\test.conf
      </code></p></div>
  
      <ul>
        <li><code>-n</code> specifies the configuration file of
        an installed Apache service (Apache 1.3.7 and later)</li>
      </ul>
  
      <div class="example"><p><code>
        apache -n "service name"
      </code></p></div>
  
      <p>In these cases, the proper <code class="directive"><a href="../mod/mod_core.html#serverroot">ServerRoot</a></code> should be set in the configuration file.</p>
  
      <p>If you don't specify a configuration file name with <code>-f</code> or
      <code>-n</code>, Apache will use the file name compiled into the server,
      usually "<code>conf/httpd.conf</code>". Invoking Apache with the
      <code>-V</code> switch will display this value labeled as
      <code>SERVER_CONFIG_FILE</code>. Apache
      will then determine its <code class="directive"><a href="../mod/mod_core.html#serverroot">ServerRoot</a></code> by trying the following, in
      this order:</p>
  
      <ul>
        <li>A <code>ServerRoot</code> directive via a
        <code>-C</code> switch.</li>
  
        <li>The <code>-d</code> switch on the command line.</li>
  
        <li>Current working directory</li>
  
        <li>A registry entry, created if you did a binary
        install.</li>
  
        <li>The server root compiled into the server.</li>
      </ul>
  
      <p>The server root compiled into the server is usually
      "<code>/apache</code>". invoking apache with the <code>-V</code> switch
      will display this value labeled as <code>HTTPD_ROOT</code>.</p>
  
      <p>When invoked from the start menu, Apache is usually passed
      no arguments, so using the registry entry is the preferred
      technique for console Apache.</p>
  
      <p>During a binary installation, a version-specific registry
      key is created in the Windows registry:</p>
  
      <div class="example"><p><code>
        HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\1.3.7 <br />
        <br />
        HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\2.0a3
      </code></p></div>
  
      <p>This key is compiled into the server and can enable you to
      test new versions without affecting the current version. Of
      course you must take care not to install the new version on top
      of the old version in the file system.</p>
  
      <p>If you did not do a binary install then Apache will in some
      scenarios complain that about the missing registry key. This
      warning can be ignored if it otherwise was able to find its
      configuration files.</p>
  
      <p>The value of this key is the <code class="directive"><a href="../mod/mod_core.html#serverroot">ServerRoot</a></code> directory, containing the <code>conf</code>
      directory. When Apache starts it will read the <code>httpd.conf</code>
      file from this directory. If this file contains a
      <code class="directive"><a href="../mod/mod_core.html#serverroot">ServerRoot</a></code> directive which
      is different from the directory obtained from the registry key above,
      Apache will forget the registry key and use the directory from the
      configuration file. If you copy the Apache directory or configuration
      files to a new location it is vital that you update the
      <code class="directive"><a href="../mod/mod_core.html#serverroot">ServerRoot</a></code> directory
      in the <code>httpd.conf</code> file to the new location.</p>
  
      <p>To run Apache from the command line as a console
      application, use the following command:</p>
  
      <div class="example"><p><code>
        apache
      </code></p></div>
  
      <p>Apache will execute, and will remain running until it is
      stopped by pressing control-C.</p>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="signalsrv" id="signalsrv">Signalling Service Apache when running</a></h2>
  
      
  
      <p>On Windows NT, multiple instances of Apache can be run as
      services. Signal an Apache service to start, restart, or
      shutdown as follows:</p>
  
      <div class="example"><p><code>
        apache -n "service name" -k start <br />
        apache -n "service name" -k restart <br />
        apache -n "service name" -k shutdown
      </code></p></div>
  
      <p>In addition, you can use the native NT <code>NET</code> command
      to start and stop Apache services as follows:</p>
  
      <div class="example"><p><code>
        NET START "service name" <br />
        NET STOP "service name"
      </code></p></div>
  
    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="signal" id="signal">Signalling Console Apache when running</a></h2>
  
      
  
      <p>On Windows 95, Apache runs as a console application. You can
      tell a running Apache to stop by opening another console window
      and typing:</p>
  
      <div class="example"><p><code>
        apache -k shutdown
      </code></p></div>
  
      <p>This should be used instead of pressing Control-C in the
      running Apache console window, because it lets Apache end any
      current transactions and cleanup gracefully.</p>
  
      <p>You can also tell Apache to restart. This makes it re-read
      the configuration files. Any transactions in progress are
      allowed to complete without interruption. To restart Apache,
      run</p>
  
      <div class="example"><p><code>
        apache -k restart
      </code></p></div>
  
      <div class="note">Note for people familiar with the Unix version of Apache:
      these commands provide a Windows equivalent to <code>kill -TERM
      <em>pid</em></code> and <code>kill -USR1 <em>pid</em></code>.
      The command line option used, <code>-k</code>, was chosen as a
      reminder of the "<code>kill</code>" command used on Unix.</div>
  
    </div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</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></body></html>
  
  
  1.1                  httpd-2.0/docs/manual/platform/windows.xml
  
  Index: windows.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
  <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
  
  <manualpage>
    <relativepath href=".." />
  
    <title>Using Apache with Microsoft Windows</title>
  
    <summary>
  
      <p>This document explains how to install, configure and run
      Apache 2.0 under Microsoft Windows. If you find any bugs, or
      wish to contribute in other ways, please use our <a
      href="http://httpd.apache.org/bug_report.html">bug reporting page.</a></p>
  
      <p>Most of this document assumes that you are installing
      Windows from a binary distribution. If you want to compile
      Apache yourself (possibly to help with development, or to track
      down bugs), see <a href="win_compiling.html">Compiling Apache
      for Microsoft Windows</a>.</p>
  
      <p><strong>At this time, support for Windows 95, 98 and ME is
      incomplete. Apache 2.0 is not expected to work on those
      platforms at this time.</strong> If you are interested in
      helping with that effort, please see the developer's site for
      information on <a href="http://dev.apache.org/">how to get
      involved</a>. Support will likely be provided at some point in
      the future, and patches to allow Apache to work on 95, 98 and
      ME are welcome!</p>
  
    </summary>
  
    <section id="req">
  
      <title>Requirements</title>
  
      <p>Apache 2.0 is designed to run on Windows NT 4.0 and Windows
      2000. The binary installer will only work with the x86 family
      of processors, such as Intel's. Apache may also run on Windows
      95, 98 and ME, but these are not tested, and are never
      recommended for production servers. In all cases TCP/IP
      networking must be installed.</p>
  
      <p>If running on Windows 95, the "Winsock2" upgrade MUST BE
      INSTALLED. "Winsock2" for Windows 95 is available <a
      href="http://www.microsoft.com/windows95/downloads/">here</a>.</p>
  
      <p>If running on NT 4.0, installing Service Pack 3 or 6 is
      recommended, as Service Pack 4 created known issues with TCP/IP
      and WinSock integrity that were resolved in later Service
      Packs.</p>
  
    </section>
  
    <section id="down">
  
      <title>Downloading Apache for Windows</title>
  
      <p>Information on the latest version of Apache can be found on
      the Apache web server at <a
      href="http://httpd.apache.org/">http://httpd.apache.org/</a>.
      This will list the current release, any more recent alpha or
      beta-test releases, together with details of mirror web and
      anonymous ftp sites.</p>
  
      <p>You should download the version of Apache for Windows with
      the <code>.msi</code> extension. This is a single Microsoft
      Installer file containing Apache, ready to install and run.
      There is a seperate <code>.zip</code> file containing <em>only</em>
      the source code, to compile Apache yourself with the Microsoft
      Visual C++ (Visual Studio) tools.</p>
  
    </section>
  
    <section id="inst">
  
      <title>Installing Apache for Windows</title>
  
      <p>Run the Apache <code>.msi</code> file you downloaded above.
      This will ask for:</p>
  
      <ul>
        <li>the directory to install Apache into (the default is
        <code>\Program Files\Apache Group\Apache</code> although you
        can change this to any other directory)</li>
  
        <li>the start menu name (default is "Apache Web Server")</li>
  
        <li>the installation type. The "Typical" option installs
        everything except the source code. The "Minimum" option does
        not install the manuals or source code. Choose the "Custom"
        install if you want to install the source code.</li>
      </ul>
  
      <p>During the installation, Apache will configure the files in
      the <code>conf</code> directory for your chosen installation
      directory. However if any of the files in this directory
      already exist they will <em>not</em> be overwritten.
      Instead the new copy of the corresponding file will be left
      with the extension <code>.default</code>. So, for example, if
      <code>conf\httpd.conf</code> already exists it will not be
      altered, but the version which would have been installed will
      be left in <code>conf\httpd.conf.default</code>. After the
      installation has finished you should manually check to see what is
      in new in the <code>.default</code> file, and if necessary
      update your existing configuration files.</p>
  
      <p>Also, if you already have a file called
      <code>htdocs\index.html</code> then it will not be overwritten
      (no <code>index.html.default</code> file will be installed
      either). This should mean it a safe to install Apache over an
      existing installation (but you will have to stop the existing
      server running before doing the installation, then start the
      new one after the installation is finished).</p>
  
      <p>After installing Apache, you should edit the configuration
      files in the <code>conf</code> directory as required. These
      files will be configured during the install ready for Apache to
      be run from the directory where it was installed, with the
      documents served from the subdirectory <code>htdocs</code>.
      There are lots of other options which should be set before you
      start really using Apache. However to get started quickly the
      files should work as installed.</p>
  
    </section>
  
    <section id="run">
  
      <title>Running Apache for Windows</title>
  
      <p>There are two ways you can run Apache:</p>
  
      <ul>
        <li><p>As a <a href="win_service.html#service">"service"</a>
        (available on Windows NT/2000, or a pseudo-service on Windows
        95, 98 or ME). This is the best option if you want Apache to
        automatically start when you machine boots, and to keep
        Apache running when you log-off.</p></li>
  
        <li><p>From a <a href="#cmdline">console window</a>. This MUST
        be used by any administrator to test before to attempting to
        run as a service.</p></li>
      </ul>
  
      <p>To run Apache from a console window, select the "Start
      Apache as console app" option from the Start menu (in Apache
      1.3.4 and earlier, this option was called "Apache Server").
      This will open a console window and start Apache running inside
      it. The window will remain active until you stop Apache. To
      stop Apache running, either select the "Shutdown Apache console
      app" icon option from the Start menu (this is not available in
      Apache 1.3.4 or earlier), or see <a href="#signal">Signalling
      Console Apache when Running</a> for how to control Apache from
      the command line.</p>
  
      <p>If the Apache console window closes immediately (or
      unexpectedly), run the "Command Prompt" from the Start Menu -
      Programs list. Change to the folder to which you installed
      Apache, type the command apache, and read the error message.
      Then change to the <code>logs</code> folder, and review the
      <code>error.log</code> file for configuration mistakes.
      If you accepted the defaults when you installed Apache,
      the commands would be:</p>
  
      <example>
        c: <br />
        cd "\program files\apache group\apache" <br />
        apache <br />
        Wait for Apache to exit, or press Ctrl+C <br />
        cd logs <br />
        more &lt;error.log
      </example>
  
      <p><strong>Complete the steps above before you proceed
      to attempt to start Apache as a Window NT/2000
      service!</strong></p>
  
      <p>To start Apache as a service, you first need to install it
      as a service. Multiple Apache services can be installed, each
      with a different name and configuration. To install the default
      Apache service named "Apache", run the "Install Apache as
      Service (NT only)" option from the Start menu. Once this is
      done you can start the "Apache" service by opening the Services
      window (in the Control Panel), selecting Apache, then clicking
      on Start. Apache will now be running in the background. You can
      later stop Apache by clicking on Stop. As an alternative to
      using the Services window, you can start and stop the "Apache"
      service from the control line with:</p>
  
      <example>
        NET START APACHE <br />
        NET STOP APACHE
      </example>
  
      <p>See <a href="#signalsrv">Signalling Service Apache when
      Running</a> for more information on installing and controlling
      Apache services.</p>
  
      <note><strong>Apache, unlike many other Windows NT/2000 services,
      logs any errors to its own <code>error.log</code> file in the
      <code>logs</code> folder within the Apache server root folder.
      You will <em>not</em> find Apache error details in the Windows
      NT Event Log.</strong></note>
  
      <p>After starting Apache running (either in a console window or
      as a service) it will be listening to port 80 (unless you
      changed the <directive module="mpm_common">Listen</directive> directive in the configuration
      files). To connect to the server and access the default page,
      launch a browser and enter this URL:</p>
  
      <example>
        http://localhost/
      </example>
  
      <p>This should respond with a welcome page, and a link to the
      Apache manual. If nothing happens or you get an error, look in
      the <code>error_log</code> file in the <code>logs</code>
      directory. If your host isn't connected to the net, you may
      have to use this URL:</p>
  
      <example>
        http://127.0.0.1/
      </example>
  
      <p>Once your basic installation is working, you should
      configure it properly by editing the files in the
      <code>conf</code> directory. Again, if you change the
      configuration of the Windows NT/2000 service for Apache, first
      attempt to start it from the command line to assure that the
      service starts with no errors.</p>
  
      <p>Because Apache <em>CANNOT</em> share the same port with
      another TCPIP application, you may need to stop or uninstall
      certain services first. These include (but are not limited to)
      other web servers, and firewall products such as BlackIce. If
      you can only start Apache with these services disabled,
      reconfigure either Apache or the other product so that they do
      not listen on the same TCPIP ports.</p>
  
    </section>
  
    <section id="use">
  
      <title>Configuring Apache for Windows</title>
  
      <p>Apache is configured by files in the <code>conf</code>
      directory. These are the same as files used to configure the
      Unix version, but there are a few different directives for
      Apache on Windows. See the <a href="../">Apache
      documentation</a> for all the available directives.</p>
  
      <p>The main differences in Apache for Windows are:</p>
  
      <ul>
        <li>
          <p>Because Apache for Windows is multithreaded, it does not
          use a separate process for each request, as Apache does
          with Unix. Instead there are usually only two Apache
          processes running: a parent process, and a child which
          handles the requests. Within the child each request is
          handled by a separate thread.</p>
  
          <p>So the "process"-management directives are
          different:</p>
  
          <p><directive module="mpm_common">MaxRequestsPerChild</directive>
          - Like the Unix directive, this controls how many requests
          a process will serve before exiting. However, unlike Unix,
          a process serves all the requests at once, not just one, so
          if this is set, it is recommended that a very high number
          is used. The recommended default, <code>MaxRequestsPerChild
          0</code>, does not cause the process to ever exit.</p>
          
          <note type="warning"><strong>Warning: The server configuration
          file is reread when the new child process is started. If you
          have modified <code>httpd.conf</code>, the new child may not
          start or you may receive unexpected results.</strong></note>
  
          <p><directive module="mpm_common">ThreadsPerChild</directive>
          - This directive is new, and tells the server how many
          threads it should use. This is the maximum number of
          connections the server can handle at once; be sure and set
          this number high enough for your site if you get a lot of
          hits. The recommended default is <code>ThreadsPerChild
          50</code>.</p>
        </li>
  
        <li>
          <p>The directives that accept filenames as arguments now
          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.</p>
        </li>
  
        <li>
          <p>Apache for Windows contains the ability to load modules
          at runtime, without recompiling the server. If Apache is
          compiled normally, it will install a number of optional
          modules in the <code>\Apache\modules</code> directory. To
          activate these, or other modules, the new <directive
          module="mod_so">LoadModule</directive>
          directive must be used. For example, to active the status
          module, use the following (in addition to the
          status-activating directives in
          <code>access.conf</code>):</p>
  
          <example>
            LoadModule status_module modules/mod_status.so
          </example>
  
          <p>Information on <a
          href="../mod/mod_so.html#creating">creating loadable
          modules</a> is also available.</p>
        </li>
  
        <li>
          <p>Apache can also load ISAPI Extensions (<em>i.e.</em>,
          Internet Server Applications), such as those used by
          Microsoft's IIS, and other Windows servers. <a
          href="../mod/mod_isapi.html">More information is
          available.</a> Note that Apache <em>CANNOT</em> load ISAPI
          Filters.</p>
        </li>
  
        <li>
          <p>When running CGI scripts, the method Apache uses to find
          the interpreter for the script is configurable using the
          <directive module="mod_core">ScriptInterpreterSource</directive>
          directive.</p>
        </li>
  
        <li>
          <p>Since it is often difficult to manage files with names
          like <code>.htaccess</code> under windows, you may find it
          useful to change the name of this configuration file using
          the <directive module="mod_core">AccessFilename</directive>
          directive.</p>
        </li>
      </ul>
  
    </section>
  
    <section id="service">
  
      <title>Running Apache for Windows as a Service</title>
  
      <note><strong>The <code>-n</code> option to specify a service name
      is only available with Apache 1.3.7 and later. Earlier versions of
      Apache only support the default service name
      "Apache".</strong></note>
  
      <p>You can install Apache as a Windows NT service as
      follows:</p>
  
      <example>
        apache -k install -n "service name"
      </example>
  
      <p>To install a service to use a particular configuration,
      specify the configuration file when the service is
      installed:</p>
  
      <example>
        apache -k install -n "service name" -f "\my server\conf\my.conf"
      </example>
  
      <p>To remove an Apache service, use</p>
  
      <example>
        apache -k uninstall -n "service name"
      </example>
  
      <p>The default "service name", if one is not specified, is
      "Apache".</p>
  
      <p>Once a service is installed, you can use the <code>-n</code>
      option, in conjunction with other options, to refer to a
      service's configuration file. For example:</p>
  
      <p>To test a service's configuration file:</p>
  
      <example>
        apache -n "service name" -t
      </example>
  
      <p>To start a console Apache using a service's configuration
      file:</p>
  
      <example>
        apache -n "service name"
      </example>
  
      <p><strong>Important Note on service dependencies:</strong></p>
  
      <p>Prior to Apache release 1.3.13, the dependencies required to
      successfully start an installed service were not configured.
      After installing a service using earlier versions of Apache,
      you must follow these steps:</p>
  
      <example>
        Run regedt32 <br />
        Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu <br />
        Double-click to open the SYSTEM, then the CurrentControlSet keys <br />
        Scroll down and click on the Apache servicename <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        &#160;&#160;&#160;&#160;Value Name: DependOnGroup <br />
        &#160;&#160;&#160;&#160;Data Type: REG_MULTI_SZ <br />
        &#160;&#160;&#160;&#160;and click OK <br />
        Leave the Multi-String Editor dialog empty and click OK <br />
        Select Edit - Add Value... from the menu <br />
        Fill in the Add Value dialog with <br />
        &#160;&#160;&#160;&#160;Value Name: DependOnService <br />
        &#160;&#160;&#160;&#160;Data Type: REG_MULTI_SZ <br />
        &#160;&#160;&#160;&#160;and click OK <br />
        Type the following list (one per line) in the Multi-String Editor dialog <br />
        &#160;&#160;&#160;&#160;Tcpip <br />
        &#160;&#160;&#160;&#160;Afd <br />
        &#160;&#160;&#160;&#160;and click OK
      </example>
  
      <p>If you are using COM or DCOM components from a third party
      module, ISAPI, or other add-in scripting technologies such as
      ActiveState Perl, you may also need to add the entry Rpcss to
      the DependOnService list. To avoid exposing the TCP port 135
      when it is unnecessary, Apache does not create that entry upon
      installation. Follow the directions above to find or create the
      DependOnService value, double click that value if it already
      exists, and add the Rpcss entry to the list.</p>
  
    </section>
  
    <section id="cmdline">
  
      <title>Running Apache for Windows from the Command Line</title>
  
      <p>The Start menu icons and the NT Service manager can provide
      a simple interface for administering Apache. But in some cases
      it is easier to work from the command line.</p>
  
      <p>When working with Apache it is important to know how it will
      find the configuration files. You can specify a configuration
      file on the command line in two ways:</p>
  
      <ul>
        <li><code>-f</code> specifies a path to a particular
        configuration file</li>
      </ul>
  
      <example>
        apache -f "c:\my server\conf\my.conf" <br />
        apache -f test\test.conf
      </example>
  
      <ul>
        <li><code>-n</code> specifies the configuration file of
        an installed Apache service (Apache 1.3.7 and later)</li>
      </ul>
  
      <example>
        apache -n "service name"
      </example>
  
      <p>In these cases, the proper <directive module="mod_core"
      >ServerRoot</directive> should be set in the configuration file.</p>
  
      <p>If you don't specify a configuration file name with <code>-f</code> or
      <code>-n</code>, Apache will use the file name compiled into the server,
      usually "<code>conf/httpd.conf</code>". Invoking Apache with the
      <code>-V</code> switch will display this value labeled as
      <code>SERVER_CONFIG_FILE</code>. Apache
      will then determine its <directive module="mod_core"
      >ServerRoot</directive> by trying the following, in
      this order:</p>
  
      <ul>
        <li>A <code>ServerRoot</code> directive via a
        <code>-C</code> switch.</li>
  
        <li>The <code>-d</code> switch on the command line.</li>
  
        <li>Current working directory</li>
  
        <li>A registry entry, created if you did a binary
        install.</li>
  
        <li>The server root compiled into the server.</li>
      </ul>
  
      <p>The server root compiled into the server is usually
      "<code>/apache</code>". invoking apache with the <code>-V</code> switch
      will display this value labeled as <code>HTTPD_ROOT</code>.</p>
  
      <p>When invoked from the start menu, Apache is usually passed
      no arguments, so using the registry entry is the preferred
      technique for console Apache.</p>
  
      <p>During a binary installation, a version-specific registry
      key is created in the Windows registry:</p>
  
      <example>
        HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\1.3.7 <br />
        <br />
        HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\2.0a3
      </example>
  
      <p>This key is compiled into the server and can enable you to
      test new versions without affecting the current version. Of
      course you must take care not to install the new version on top
      of the old version in the file system.</p>
  
      <p>If you did not do a binary install then Apache will in some
      scenarios complain that about the missing registry key. This
      warning can be ignored if it otherwise was able to find its
      configuration files.</p>
  
      <p>The value of this key is the <directive module="mod_core"
      >ServerRoot</directive> directory, containing the <code>conf</code>
      directory. When Apache starts it will read the <code>httpd.conf</code>
      file from this directory. If this file contains a
      <directive module="mod_core">ServerRoot</directive> directive which
      is different from the directory obtained from the registry key above,
      Apache will forget the registry key and use the directory from the
      configuration file. If you copy the Apache directory or configuration
      files to a new location it is vital that you update the
      <directive module="mod_core">ServerRoot</directive> directory
      in the <code>httpd.conf</code> file to the new location.</p>
  
      <p>To run Apache from the command line as a console
      application, use the following command:</p>
  
      <example>
        apache
      </example>
  
      <p>Apache will execute, and will remain running until it is
      stopped by pressing control-C.</p>
  
    </section>
  
    <section id="signalsrv">
  
      <title>Signalling Service Apache when running</title>
  
      <p>On Windows NT, multiple instances of Apache can be run as
      services. Signal an Apache service to start, restart, or
      shutdown as follows:</p>
  
      <example>
        apache -n "service name" -k start <br />
        apache -n "service name" -k restart <br />
        apache -n "service name" -k shutdown
      </example>
  
      <p>In addition, you can use the native NT <code>NET</code> command
      to start and stop Apache services as follows:</p>
  
      <example>
        NET START "service name" <br />
        NET STOP "service name"
      </example>
  
    </section>
  
    <section id="signal">
  
      <title>Signalling Console Apache when running</title>
  
      <p>On Windows 95, Apache runs as a console application. You can
      tell a running Apache to stop by opening another console window
      and typing:</p>
  
      <example>
        apache -k shutdown
      </example>
  
      <p>This should be used instead of pressing Control-C in the
      running Apache console window, because it lets Apache end any
      current transactions and cleanup gracefully.</p>
  
      <p>You can also tell Apache to restart. This makes it re-read
      the configuration files. Any transactions in progress are
      allowed to complete without interruption. To restart Apache,
      run</p>
  
      <example>
        apache -k restart
      </example>
  
      <note>Note for people familiar with the Unix version of Apache:
      these commands provide a Windows equivalent to <code>kill -TERM
      <em>pid</em></code> and <code>kill -USR1 <em>pid</em></code>.
      The command line option used, <code>-k</code>, was chosen as a
      reminder of the "<code>kill</code>" command used on Unix.</note>
  
    </section>
  
  </manualpage>