<h2><a name="req" id="req">Operating System Requirements</a></h2>
<p>The primary Windows platform for running Apache 2.0 is Windows
NT. The binary installer only works with the x86 family of
processors, such as Intel and AMD processors. Running Apache on
Windows 9x is not thoroughly tested, and it is never recommended on
production systems.
</p>
<p>On all operating systems, TCP/IP networking must be installed
and working. If running on Windows 95, the Winsock 2 upgrade must
be installed. Winsock 2 for Windows 95 can be downloaded from <a href="http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp">here</a>.
</p>
<p>On Windows NT 4.0, installing Service Pack 6 is strongly
recommended, as Service Pack 4 created known issues with TCP/IP
and Winsock integrity that were resolved in later Service Packs.</p>
<code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, and <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code> directives all use
case-sensitive arguments. For this reason, it is particularly
important to use the <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> directive when attempting
to limit access to content in the filesystem, since this
directive applies to any content in a directory, regardless of
how it is accessed. If you wish to assure that only lowercase
is used in URLs, you can use something like:</p>
<div class="example"><p><code>
RewriteEngine On<br />
RewriteMap lowercase int:tolower<br />
RewriteCond %{REQUEST_URI} [A-Z]<br />
RewriteRule (.*) ${lowercase:$1} [R,L]
</code></p></div></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>\Apache2\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 activate 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 (Internet Server Application
Programming Interface) extensions (i.e. internet server
applications), such as those used by Microsoft IIS and other
Windows servers. <a href="../mod/mod_isapi.html">More information
is available</a>. Note that Apache <strong>cannot</strong> 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
<h2><a name="wincons" id="wincons">Running Apache as a Console Application</a></h2>
<p>Running Apache as a service is usually the recommended way to
use it, but it is sometimes easier to work from the command line
(on Windows 9x running Apache from the command line is the
recommended way due to the lack of reliable service support.)</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>
<p>You can also run Apache via the shortcut Start Apache in Console
placed to <code>Start Menu --> Programs --> Apache HTTP Server
2.0.xx --> Control Apache Server</code> during the installation.
This will open a console window and start Apache inside it. If you
don't have Apache installed as a service, the window will remain
visible until you stop Apache by pressing Control-C in the console
window where Apache is running in. The server will exit in a few
seconds. However, if you do have Apache installed as a service, the
shortcut starts the service. If the Apache service is running
already, the shortcut doesn't do anything.</p>
<p>You can tell a running Apache to stop by opening another console
window and entering:</p>
<div class="example"><p><code>
httpd -k shutdown
</code></p></div>
<p>This should be preferred over pressing Control-C because this
lets Apache end any current operations and clean up gracefully.</p>
<p>You can also tell Apache to restart. This forces it to reread
the configuration file. Any operations in progress are allowed to
complete without interruption. To restart Apache, use:</p>
<div class="example"><p><code>
httpd -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>
<p>If the Apache console window closes immediately or unexpectedly
after startup, open the Command Prompt from the Start Menu -->
Programs. Change to the folder to which you installed Apache, type
the command <code>httpd</code>, and read the error message. Then
change to the logs 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 Software Foundation\Apache2.2\bin" <br />
httpd
</code></p></div>
<p>Then wait for Apache to stop, or press Control-C. Then enter the
following:</p>
<div class="example"><p><code>
cd ..\logs <br />
more < error.log
</code></p></div>
<p>When working with Apache it is important to know how it will
find the configuration file. You can specify a configuration file
on the command line in two ways:</p>
<ul>
<li><p><code>-f</code> specifies an absolute or relative path to
a particular configuration file:</p>
<div class="example"><p><code>
httpd -f "c:\my server files\anotherconfig.conf"
</code></p></div>
<p>or</p>
<div class="example"><p><code>
httpd -f files\anotherconfig.conf
</code></p></div></li>
<li><p><code>-n</code> specifies the installed Apache service
whose configuration file is to be used:</p>
<div class="example"><p><code>
httpd -n "MyServiceName"
</code></p></div>
</li>
</ul>
<p>In both of these cases, the proper
<code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> should be set in
the configuration file.</p>
<p>If you don't specify a configuration file with <code>-f</code>
or <code>-n</code>, Apache will use the file name compiled into the
server, such as <code>conf\httpd.conf</code>. This built-in path
is relative to the installation directory. You can verify the compiled
file name from a value labelled as <code>SERVER_CONFIG_FILE</code> when
invoking Apache with the <code>-V</code> switch, like this:</p>
<div class="example"><p><code>
httpd -V
</code></p></div>
<p>Apache will then try to determine its <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> by trying the following, in this order:</p>
<h2><a name="test" id="test">Testing the Installation</a></h2>
<p>After starting Apache (either in a console window or as a
service) it will be listening on port 80 (unless you changed the
<code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive in the
configuration files or installed Apache only for the current user).
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>Apache should respond with a welcome page and you should see
"It Works!". If nothing happens or you get an error, look in the
<code>error.log</code> file in the <code>logs</code> subdirectory.
If your host is not connected to the net, or if you have serious
problems with your DNS (Domain Name Service) configuration, you
may have to use this URL:</p>
<div class="example"><p><code>
http://127.0.0.1/
</code></p></div>
<p>If you happen to be running Apache on an alternate port, you
need to explicitly put that in the URL:</p>
<div class="example"><p><code>
http://127.0.0.1:8080/
</code></p></div>
<p>Once your basic installation is working, you should configure it
properly by editing the files in the <code>conf</code> subdirectory.
Again, if you change the configuration of the Windows NT service
for Apache, first attempt to start it from the command line to
make sure that the service starts with no errors.</p>
<p>Because Apache <strong>cannot</strong> share the same port with
another TCP/IP application, you may need to stop, uninstall or reconfigure
certain other services before running Apache. These conflicting
services include other WWW servers and some firewall implementations.
</p>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/platform/windows.html" title="English"> en </a> |
<a href="../ko/platform/windows.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>