]> granicus.if.org Git - apache/blob - docs/manual/platform/windows.xml
update transformation
[apache] / docs / manual / platform / windows.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <manualpage metafile="windows.xml.meta">
24   <parentdocument href="./">Platform Specific Notes</parentdocument>
25
26   <title>Using Apache with Microsoft Windows</title>
27
28   <summary>
29
30     <p>This document explains how to install, configure and run
31     Apache 2.0 under Microsoft Windows. If you find any bugs, or
32     wish to contribute in other ways, please use our <a
33     href="http://httpd.apache.org/bug_report.html">bug reporting
34     page</a>.</p>
35
36     <p>This document assumes that you are installing a binary
37     distribution of Apache. If you want to compile Apache yourself
38     (possibly to help with development or tracking down bugs),
39     see <a href="win_compiling.html">Compiling Apache for Microsoft
40     Windows</a>.</p>
41
42     <p><strong>Because of the current versioning policies on Microsoft
43     Windows operating system families, this document assumes the
44     following:</strong></p>
45     <ul>
46       <li><strong>Windows NT:</strong> This means all versions of
47       Windows that are based on the Windows NT kernel. Includes Windows
48       NT, Windows 2000, Windows XP and Windows .Net Server 2003.</li>
49       <li><strong>Windows 9x:</strong> This means older,
50       consumer-oriented versions of Windows. Includes Windows 95 (also
51       OSR2), Windows 98 and Windows ME.</li>
52     </ul>
53
54   </summary>
55
56   <section id="req">
57     <title>Operating System Requirements</title>
58
59     <p>The primary Windows platform for running Apache 2.0 is Windows
60     NT. The binary installer only works with the x86 family of
61     processors, such as Intel and AMD processors. Running Apache on
62     Windows 9x is not thoroughly tested, and it is never recommended on
63     production systems.
64     </p>
65
66     <p>On all operating systems, TCP/IP networking must be installed
67     and working. If running on Windows 95, the Winsock 2 upgrade must
68     be installed. Winsock 2 for Windows 95 can be downloaded from <a
69     href="http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp">here</a>.
70     </p>
71
72     <p>On Windows NT 4.0, installing Service Pack 6 is strongly
73     recommended, as Service Pack 4 created known issues with TCP/IP
74     and Winsock integrity that were resolved in later Service Packs.</p>
75   </section>
76
77   <section id="down">
78     <title>Downloading Apache for Windows</title>
79
80     <p>Information on the latest versions of Apache can be found on the
81     web site of the Apache web server at
82     <a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a>.
83     There you will find the current release, as well as more recent alpha
84     or beta test versions, and a list of HTTP and FTP mirrors from which
85     you can download the Apache web server. Please use a mirror near to
86     you for a fast and reliable download.</p>
87
88     <p>For Windows installations you should download the version of
89     Apache for Windows with the <code>.msi</code> extension. This is a
90     single Microsoft Installer file, which contains a ready-to-run
91     version of Apache. There is a separate <code>.zip</code> file,
92     which contains only the source code. You can compile Apache
93     yourself with the Microsoft Visual C++ (Visual Studio) tools.</p>
94   </section>
95
96   <section id="inst">
97     <title>Installing Apache for Windows</title>
98
99     <p>You need Microsoft Installer 1.2 or above for the installation
100     to work. On Windows 9x you can update your Microsoft Installer to
101     version 2.0 <a
102     href="http://www.microsoft.com/downloads/release.asp?ReleaseID=32831">here</a>
103     and on Windows NT 4.0 and 2000 the version 2.0 update can be found
104     <a href="http://www.microsoft.com/downloads/release.asp?ReleaseID=32832">here</a>.
105     Windows XP does not need this update.</p>
106
107     <p>Note that you cannot install two versions of Apache 2.0 on the
108     same computer with the binary installer. You can, however, install
109     a version of the 1.3 series <strong>and</strong> a version of the
110     2.0 series on the same computer without problems. If you need to
111     have two different 2.0 versions on the same computer, you have to
112     <a href="win_compiling.html">compile and install Apache from the
113     source</a>.</p>
114
115     <p>Run the Apache <code>.msi</code> file you downloaded above. The
116     installation will ask you for these things:</p>
117
118     <ol>
119       <li><p><strong>Network Domain.</strong> Enter the DNS domain in which
120       your server is or will be registered in. For example, if your
121       server's full DNS name is <code>server.mydomain.net</code>, you would
122       type <code>mydomain.net</code> here.</p></li>
123
124       <li><p><strong>Server Name.</strong> Your server's full DNS name.
125       From the example above, you would type <code>server.mydomain.net</code>
126       here.</p></li>
127
128       <li><p><strong>Administrator's Email Address.</strong> Enter the
129       server administrator's or webmaster's email address here. This
130       address will be displayed along with error messages to the client
131       by default.</p></li>
132
133       <li><p><strong>For whom to install Apache</strong> Select <code>for
134       All Users, on Port 80, as a Service - Recommended</code> if you'd
135       like your new Apache to listen at port 80 for incoming traffic.
136       It will run as a service (that is, Apache will run even if no one
137       is logged in on the server at the moment) Select <code>only for
138       the Current User, on Port 8080, when started Manually</code> if
139       you'd like to install Apache for your personal experimenting or
140       if you already have another WWW server running on port 80.</p></li>
141
142       <li><p><strong>The installation type.</strong> Select <code>Typical</code>
143       for everything except the source code and libraries for module
144       development. With <code>Custom</code> you can specify what to
145       install. A full install will require about 13 megabytes of free
146       disk space. This does <em>not</em> include the size of your web
147       site(s).</p></li>
148
149       <li><p><strong>Where to install.</strong> The default path is
150       <code>C:\Program Files\Apache Group</code> under which a directory
151       called <code>Apache2</code> will be created by default.</p></li>
152     </ol>
153
154     <p>During the installation, Apache will configure the files in the
155     <code>conf</code> subdirectory to reflect the chosen installation
156     directory. However, if any of the configuration files in this
157     directory already exist, they will not be overwritten. Instead, the
158     new copy of the corresponding file will be left with the extension
159     <code>.default</code>. So, for example, if <code>conf\httpd.conf</code>
160     already exists, it will be renamed as <code>conf\httpd.conf.default</code>.
161     After the installation you should manually check to see what new
162     settings are in the <code>.default</code> file, and if necessary,
163     update your existing configuration file.</p>
164
165     <p>Also, if you already have a file called <code>htdocs\index.html</code>,
166     it will not be overwritten (and no <code>index.html.default</code>
167     will be installed either). This means it should be safe to install
168     Apache over an existing installation, although you would have to
169     stop the existing running server before doing the installation, and
170     then start the new one after the installation is finished.</p>
171
172     <p>After installing Apache, you must edit the configuration files
173     in the <code>conf</code> subdirectory as required. These files
174     will be configured during the installation so that Apache is ready
175     to be run from the directory it was installed into, with the
176     documents server from the subdirectory <code>htdocs</code>. There
177     are lots of other options which you should set before you really
178     start using Apache. However, to get started quickly, the files
179     should work as installed.</p>
180   </section>
181
182   <section id="cust">
183     <title>Customizing Apache for Windows</title>
184
185     <p>Apache is configured by the files in the <code>conf</code>
186     subdirectory. These are the same files used to configure the Unix
187     version, but there are a few different directives for Apache on
188     Windows. See the <a href="../mod/directives.html">directive index</a>
189     for all the available directives.</p>
190
191     <p>The main differences in Apache for Windows are:</p>
192     <ul>
193       <li><p>Because Apache for Windows is multithreaded, it does not
194       use a separate process for each request, as Apache does on Unix.
195       Instead there are usually only two Apache processes running: a
196       parent process, and a child which handles the requests. Within
197       the child process each request is handled by a separate thread.
198       </p>
199
200       <p>The process management directives are also different:</p>
201
202       <p><directive module="mpm_common">MaxRequestsPerChild</directive>:
203       Like the Unix directive, this controls how many requests a single
204       child process will serve before exiting. However, unlike on Unix,
205       a single process serves all the requests at once, not just one.
206       If this is set, it is recommended that a very high number is
207       used. The recommended default, <code>MaxRequestsPerChild 0</code>,
208       causes the child process to never exit.</p>
209
210       <note type="warning"><strong>Warning: The server configuration
211       file is reread when a new child process is started. If you have
212       modified <code>httpd.conf</code>, the new child may not start or
213       you may receive unexpected results.</strong></note>
214
215       <p><directive module="mpm_common">ThreadsPerChild</directive>:
216       This directive is new. It tells the server how many threads it
217       should use. This is the maximum number of connections the server
218       can handle at once, so be sure to set this number high enough for
219       your site if you get a lot of hits. The recommended default is
220       <code>ThreadsPerChild 50</code>.</p></li>
221
222       <li><p>The directives that accept filenames as arguments must use
223       Windows filenames instead of Unix ones. However, because Apache
224       uses Unix-style names internally, you must use forward slashes,
225       not backslashes. Drive letters can be used; if omitted, the drive
226       with the Apache executable will be assumed.</p></li>
227
228       <li><p>While filenames are generally case-insensitive on
229       Windows, URLs are still treated internally as case-sensitive
230       before they are mapped to the filesystem.  For example, the
231       <directive module="core" type="section">Location</directive>,
232       <directive module="mod_alias">Alias</directive>, and <directive
233       module="mod_proxy">ProxyPass</directive> directives all use
234       case-sensitive arguments.  For this reason, it is particularly
235       important to use the <directive module="core"
236       type="section">Directory</directive> directive when attempting
237       to limit access to content in the filesystem, since this
238       directive applies to any content in a directory, regardless of
239       how it is accessed.  If you wish to assure that only lowercase
240       is used in URLs, you can use something like:</p>
241
242       <example>
243       RewriteEngine On<br />
244       RewriteMap lowercase int:tolower<br />
245       RewriteCond %{REQUEST_URI} [A-Z]<br />
246       RewriteRule (.*) ${lowercase:$1} [R,L]
247       </example></li>
248
249       <li><p>Apache for Windows contains the ability to load modules at
250       runtime, without recompiling the server. If Apache is compiled
251       normally, it will install a number of optional modules in the
252       <code>\Apache2\modules</code> directory. To activate these or
253       other modules, the new <directive module="mod_so">LoadModule</directive>
254       directive must be used. For example, to activate the status
255       module, use the following (in addition to the status-activating
256       directives in <code>access.conf</code>):</p>
257
258       <example>
259         LoadModule status_module modules/mod_status.so
260       </example>
261
262       <p>Information on <a href="../mod/mod_so.html#creating">creating
263       loadable modules</a> is also available.</p></li>
264
265       <li><p>Apache can also load ISAPI (Internet Server Application
266       Programming Interface) extensions (i.e. internet server
267       applications), such as those used by Microsoft IIS and other
268       Windows servers. <a href="../mod/mod_isapi.html">More information
269       is available</a>. Note that Apache <strong>cannot</strong> load
270       ISAPI Filters.</p></li>
271
272       <li><p>When running CGI scripts, the method Apache uses to find
273       the interpreter for the script is configurable using the
274       <directive module="core">ScriptInterpreterSource</directive>
275       directive.</p></li>
276
277       <li><p>Since it is often difficult to manage files with names
278       like <code>.htaccess</code> in Windows, you may find it useful to
279       change the name of this per-directory configuration file using
280       the <directive module="core">AccessFilename</directive>
281       directive.</p></li>
282
283       <li><p>Any errors during Apache startup are logged into the
284       Windows event log when running on Windows NT. This mechanism
285       acts as a backup for those situations where Apache cannot even
286       access the normally used <code>error.log</code> file. You can
287       view the Windows event log by using the Event Viewer application
288       on Windows NT 4.0, and the Event Viewer MMC snap-in on newer
289       versions of Windows.</p>
290
291       <note><strong>Note that there is no startup error logging on
292       Windows 9x because no Windows event log exists on those operating
293       systems.</strong></note></li>
294     </ul>
295
296   </section>
297
298   <section id="winsvc">
299     <title>Running Apache as a Service</title>
300
301     <p>Apache can be run as a service on Windows NT. There is some
302     highly experimental support for similar behavior on Windows 9x.</p>
303
304     <p>You can install Apache as a service automatically during the
305     installation. If you chose to install for all users, the
306     installation will create an Apache service for you. If you specify
307     to install for yourself only, you can manually register Apache as a
308     service after the installation. You have to be a member of the
309     Administrators group for the service installation to succeed.</p>
310
311     <p>Apache comes with a utility called the Apache Service Monitor.
312     With it you can see and manage the state of all installed Apache
313     services on any machine on your network. To be able to manage an
314     Apache service with the monitor, you have to first install the
315     service (either automatically via the installation or manually).
316     </p>
317
318     <p>You can install Apache as a Windows NT service as follows from
319     the command prompt at the Apache <code>bin</code> subdirectory:</p>
320
321     <example>
322       httpd -k install
323     </example>
324
325     <p>If you need to specify the name of the service you want to
326     install, use the following command. You have to do this if you
327     have several different service installations of Apache on your
328     computer.</p>
329
330     <example>
331       httpd -k install -n "MyServiceName"
332     </example>
333
334     <p>If you need to have specifically named configuration files for
335     different services, you must use this:</p>
336
337     <example>
338       httpd -k install -n "MyServiceName" -f "c:\files\my.conf"
339     </example>
340
341     <p>If you use the first command without any special parameters except
342     <code>-k install</code>, the service will be called <code>Apache2</code>
343     and the configuration will be assumed to be <code>conf\httpd.conf</code>.
344     </p>
345
346     <p>Removing an Apache service is easy. Just use:</p>
347
348     <example>
349       httpd -k uninstall
350     </example>
351
352     <p>The specific Apache service to be uninstalled can be specified by using:</p>
353
354     <example>
355       httpd -k uninstall -n "MyServiceName"
356     </example>
357
358     <p>Normal starting, restarting and shutting down of an Apache
359     service is usually done via the Apache Service Monitor, by using
360     commands like <code>NET START Apache2</code> and <code>NET STOP
361     Apache2</code> or via normal Windows service management. Before
362     starting Apache as a service by any means, you should test the
363     service's configuration file by using:</p>
364
365     <example>
366       httpd -n "MyServiceName" -t
367     </example>
368
369     <p>You can control an Apache service by its command line switches,
370     too. To start an installed Apache service you'll use this:</p>
371
372     <example>
373       httpd -k start
374     </example>
375
376     <p>To stop an Apache service via the command line switches, use
377     this:</p>
378
379     <example>
380       httpd -k stop
381     </example>
382
383     <p>or</p>
384
385     <example>
386       httpd -k shutdown
387     </example>
388
389     <p>You can also restart a running service and force it to reread
390     its configuration file by using:</p>
391
392     <example>
393       httpd -k restart
394     </example>
395
396     <p>By default, all Apache services are registered to run as the
397     system user (the <code>LocalSystem</code> account). The
398     <code>LocalSystem</code> account has no privileges to your network
399     via any Windows-secured mechanism, including the file system, named
400     pipes, DCOM, or secure RPC. It has, however, wide privileges locally.
401     </p>
402
403     <note type="warning"><strong>Never grant any network privileges to
404     the <code>LocalSystem</code> account! If you need Apache to be able
405     to access network resources, create a separate account for Apache as
406     noted below.</strong></note>
407
408     <p>You may want to create a separate account for running Apache
409     service(s). Especially, if you have to access network resources
410     via Apache, this is strongly recommended.</p>
411
412     <ol>
413       <li>Create a normal domain user account, and be sure to
414       memorize its password.</li>
415
416       <li>Grant the newly-created user a privilege of <code>Log on
417       as a service</code> and <code>Act as part of the operating
418       system</code>. On Windows NT 4.0 these privileges are granted via
419       User Manager for Domains, but on Windows 2000 and XP you probably
420       want to use Group Policy for propagating these settings. You can
421       also manually set these via the Local Security Policy MMC snap-in.
422       </li>
423
424       <li>Confirm that the created account is a member of the Users
425       group.</li>
426
427       <li>Grant the account read and execute (RX) rights to all document
428       and script folders (<code>htdocs</code> and <code>cgi-bin</code>
429       for example).</li>
430
431       <li>Grant the account change (RWXD) rights to the
432       Apache <code>logs</code> directory.</li>
433
434       <li>Grant the account read and execute (RX) rights to the
435       <code>Apache.exe</code> binary executable.</li>
436     </ol>
437
438     <note>It is usually a good practice to grant the user the Apache
439     service runs as read and execute (RX) access to the whole Apache2
440     directory, except the <code>logs</code> subdirectory, where the
441     user has to have at least change (RWXD) rights.</note>
442
443     <p>If you allow the account to log in as a user and as a service,
444     then you can log on with that account and test that the account has the
445     privileges to execute the scripts, read the web pages, and that
446     you can start Apache in a console window. If this works, and you
447     have followed the steps above, Apache should execute as a service
448     with no problems.</p>
449
450     <note><strong>Error code 2186</strong> is a good indication that
451     you need to review the "Log On As" configuration for the service,
452     since Apache cannot access a required network resource. Also, pay
453     close attention to the privileges of the user Apache is
454     configured to run as.</note>
455
456     <p>When starting Apache as a service you may encounter an error
457     message from the Windows Service Control Manager. For example,
458     if you try to start Apache by using the Services applet in the
459     Windows Control Panel, you may get the following message:</p>
460
461     <example>
462       Could not start the Apache2 service on \\COMPUTER <br />
463       Error 1067; The process terminated unexpectedly.
464     </example>
465
466     <p>You will get this generic error if there is any problem with
467     starting the Apache service. In order to see what is really causing
468     the problem you should follow the instructions for Running Apache
469     for Windows from the Command Prompt.</p>
470
471     <p>There is some support for Apache on Windows 9x to behave in a
472     similar manner as a service on Windows NT. It is <strong>highly
473     experimental</strong>. It is not of production-class reliability,
474     and its future is not guaranteed. It can be mostly regarded as
475     a risky thing to play with - proceed with caution!</p>
476
477     <p>There are some differences between the two kinds of services
478     you should be aware of:</p>
479
480     <ul>
481       <li><p>Apache will attempt to start and if successful it will run
482       in the background. If you run the command</p>
483
484       <example>
485         httpd -n "MyServiceName" -k start
486       </example>
487
488       <p>via a shortcut on your desktop, for example, then if the
489       service starts successfully, a console window will flash up but
490       it immediately disappears. If Apache detects any errors on startup
491       such as incorrect entries in the httpd.conf configuration file,
492       the console window will remain visible. This will display an error
493       message which will be useful in tracking down the cause of the
494       problem.</p></li>
495
496       <li><p>Windows 9x does not support <code>NET START</code> or
497       <code>NET STOP</code> commands. You must control the Apache
498       service on the command prompt via the <code>-k</code> switches.
499       </p></li>
500
501       <li><p>Apache and Windows 9x offer no support for running Apache
502       as a specific user with network privileges. In fact, Windows 9x
503       offers no security on the local machine, either. This is the
504       simple reason because of which the Apache Software Foundation
505       never endorses use of a Windows 9x -based system as a public
506       Apache server. The primitive support for Windows 9x exists only
507       to assist the user in developing web content and learning the
508       Apache server, and perhaps as an intranet server on a secured,
509       private network.</p></li>
510
511     </ul>
512
513     <p>Once you have confirmed that Apache runs correctly as a
514     console application you can install, control and uninstall the
515     pseudo-service with the same commands as on Windows NT. You can
516     also use the Apache Service Monitor to manage Windows 9x
517     pseudo-services.</p>
518
519   </section>
520
521   <section id="wincons">
522     <title>Running Apache as a Console Application</title>
523
524     <p>Running Apache as a service is usually the recommended way to
525     use it, but it is sometimes easier to work from the command line
526     (on Windows 9x running Apache from the command line is the
527     recommended way due to the lack of reliable service support.)</p>
528
529     <p>To run Apache from the command line as a console application,
530     use the following command:</p>
531
532     <example>
533       httpd
534     </example>
535
536     <p>Apache will execute, and will remain running until it is stopped
537     by pressing Control-C.</p>
538
539     <p>You can also run Apache via the shortcut Start Apache in Console
540     placed to <code>Start Menu --&gt; Programs --&gt; Apache HTTP Server
541     2.0.xx --&gt; Control Apache Server</code> during the installation.
542     This will open a console window and start Apache inside it. If you
543     don't have Apache installed as a service, the window will remain
544     visible until you stop Apache by pressing Control-C in the console
545     window where Apache is running in. The server will exit in a few
546     seconds. However, if you do have Apache installed as a service, the
547     shortcut starts the service. If the Apache service is running
548     already, the shortcut doesn't do anything.</p>
549
550     <p>You can tell a running Apache to stop by opening another console
551     window and entering:</p>
552
553     <example>
554       httpd -k shutdown
555     </example>
556
557     <p>This should be preferred over pressing Control-C because this
558     lets Apache end any current operations and clean up gracefully.</p>
559
560     <p>You can also tell Apache to restart. This forces it to reread
561     the configuration file. Any operations in progress are allowed to
562     complete without interruption. To restart Apache, use:</p>
563
564     <example>
565       httpd -k restart
566     </example>
567
568     <note>Note for people familiar with the Unix version of Apache:
569     these commands provide a Windows equivalent to <code>kill -TERM
570     <em>pid</em></code> and <code>kill -USR1 <em>pid</em></code>. The
571     command line option used, <code>-k</code>, was chosen as a reminder
572     of the <code>kill</code> command used on Unix.</note>
573
574     <p>If the Apache console window closes immediately or unexpectedly
575     after startup, open the Command Prompt from the Start Menu --&gt;
576     Programs. Change to the folder to which you installed Apache, type
577     the command <code>apache</code>, and read the error message. Then
578     change to the logs folder, and review the <code>error.log</code>
579     file for configuration mistakes. If you accepted the defaults when
580     you installed Apache, the commands would be:</p>
581
582     <example>
583       c: <br />
584       cd "\Program Files\Apache Group\Apache2\bin" <br />
585       httpd
586     </example>
587
588     <p>Then wait for Apache to stop, or press Control-C. Then enter the
589     following:</p>
590
591     <example>
592       cd ..\logs <br />
593       more &lt; error.log
594     </example>
595
596     <p>When working with Apache it is important to know how it will
597     find the configuration file. You can specify a configuration file
598     on the command line in two ways:</p>
599
600     <ul>
601       <li><p><code>-f</code> specifies an absolute or relative path to
602       a particular configuration file:</p>
603
604       <example>
605         httpd -f "c:\my server files\anotherconfig.conf"
606       </example>
607
608       <p>or</p>
609
610       <example>
611         httpd -f files\anotherconfig.conf
612       </example></li>
613
614       <li><p><code>-n</code> specifies the installed Apache service
615       whose configuration file is to be used:</p>
616
617       <example>
618         httpd -n "MyServiceName"
619       </example>
620       </li>
621     </ul>
622
623     <p>In both of these cases, the proper
624     <directive module="core">ServerRoot</directive> should be set in
625     the configuration file.</p>
626
627     <p>If you don't specify a configuration file with <code>-f</code>
628     or <code>-n</code>, Apache will use the file name compiled into the
629     server, such as <code>conf\httpd.conf</code>. This built-in path
630     is relative to the installation directory. You can verify the compiled
631     file name from a value labelled as <code>SERVER_CONFIG_FILE</code> when
632     invoking Apache with the <code>-V</code> switch, like this:</p>
633
634     <example>
635       httpd.exe -V
636     </example>
637
638     <p>Apache will then try to determine its <directive module="core"
639     >ServerRoot</directive> by trying the following, in this order:</p>
640
641     <ol>
642       <li>A <directive module="core">ServerRoot</directive> directive
643       via the <code>-C</code> command line switch.</li>
644
645       <li>The <code>-d</code> switch on the command line.</li>
646
647       <li>Current working directory.</li>
648
649       <li>A registry entry which was created if you did a binary
650       installation.</li>
651
652       <li>The server root compiled into the server. This is <code>
653       /apache</code> by default, you can verify it by using <code>
654       apache -V</code> and looking for a value labelled as
655       <code>HTTPD_ROOT</code>.</li>
656     </ol>
657
658     <p>During the installation, a version-specific registry key is
659     created in the Windows registry. The location of this key depends
660     on the type of the installation. If you chose to install Apache
661     for all users, the key is located under the
662     <code>HKEY_LOCAL_MACHINE</code> hive, like this (the version
663     numbers will of course vary between different versions of Apache:
664     </p>
665
666     <example>
667       HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\2.0.43
668     </example>
669
670     <p>Correspondingly, if you chose to install Apache for the current
671     user only, the key is located under the <code>HKEY_CURRENT_USER</code>
672     hive, the contents of which are dependent of the user currently
673     logged on:</p>
674
675     <example>
676       HKEY_CURRENT_USER\SOFTWARE\Apache Group\Apache\2.0.43
677     </example>
678
679     <p>This key is compiled into the server and can enable you to test
680     new versions without affecting the current version. Of course, you
681     must take care not to install the new version in the same
682     directory as another version.</p>
683
684     <p>If you did not do a binary install, Apache will in some
685     scenarios complain about the missing registry key. This warning can
686     be ignored if the server was otherwise able to find its
687     configuration file.</p>
688
689     <p>The value of this key is the
690     <directive module="core">ServerRoot</directive> directory which
691     contains the <code>conf</code> subdirectory. When Apache starts it
692     reads the <code>httpd.conf</code> file from that directory. If
693     this file contains a <directive module="core">ServerRoot</directive>
694     directive which contains a different directory from the one
695     obtained from the registry key above, Apache will forget the
696     registry key and use the directory from the configuration file. If
697     you copy the Apache directory or configuration files to a new
698     location it is vital that you update the
699     <directive module="core">ServerRoot</directive> directive in the
700     <code>httpd.conf</code> file to reflect the new location.</p>
701
702   </section>
703
704   <section id="test">
705     <title>Testing the Installation</title>
706
707     <p>After starting Apache (either in a console window or as a
708     service) it will be listening on port 80 (unless you changed the
709     <directive module="mpm_common">Listen</directive> directive in the
710     configuration files or installed Apache only for the current user).
711     To connect to the server and access the default page, launch a
712     browser and enter this URL:</p>
713
714     <example>
715       http://localhost/
716     </example>
717
718     <p>Apache should respond with a welcome page and a link to the
719     Apache manual. If nothing happens or you get an error, look in the
720     <code>error.log</code> file in the <code>logs</code> subdirectory.
721     If your host is not connected to the net, or if you have serious
722     problems with your DNS (Domain Name Service) configuration, you
723     may have to use this URL:</p>
724
725     <example>
726       http://127.0.0.1/
727     </example>
728
729     <p>If you happen to be running Apache on an alternate port, you
730     need to explicitly put that in the URL:</p>
731    
732     <example>
733        http://127.0.0.1:8080/
734     </example>
735
736     <p>Once your basic installation is working, you should configure it
737     properly by editing the files in the <code>conf</code> subdirectory.
738     Again, if you change the configuration of the Windows NT service
739     for Apache, first attempt to start it from the command line to
740     make sure that the service starts with no errors.</p>
741
742     <p>Because Apache <strong>cannot</strong> share the same port with
743     another TCP/IP application, you may need to stop, uninstall or reconfigure
744     certain other services before running Apache. These conflicting
745     services include other WWW servers and some firewall implementations.
746     </p>
747
748   </section>
749
750 </manualpage>