1<?xml version="1.0" encoding="ISO-8859-1"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>Using Apache HTTP Server on Microsoft Windows - Apache HTTP Server</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.min.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body id="manual-page"><div id="page-header"> 17<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p> 18<p class="apache">Apache HTTP Server Version 2.4</p> 19<img alt="" src="/images/feather.gif" /></div> 20<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 21<div id="path"> 22<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Platform Specific Notes</a></div><div id="page-content"><div id="preamble"><h1>Using Apache HTTP Server on Microsoft Windows</h1> 23<div class="toplang"> 24<p><span>Available Languages: </span><a href="/en/platform/windows.html" title="English"> en </a> | 25<a href="/fr/platform/windows.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 26<a href="/ko/platform/windows.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 27</div> 28 29 <p>This document explains how to install, configure and run 30 Apache 2.4 under Microsoft Windows. If you have questions after 31 reviewing the documentation (and any event and error logs), you 32 should consult the peer-supported 33 <a href="http://httpd.apache.org/userslist.html">users' mailing 34 list</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 </div> 42<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#req">Operating System Requirements</a></li> 43<li><img alt="" src="/images/down.gif" /> <a href="#down">Downloading Apache for Windows</a></li> 44<li><img alt="" src="/images/down.gif" /> <a href="#cust">Customizing Apache for Windows</a></li> 45<li><img alt="" src="/images/down.gif" /> <a href="#winsvc">Running Apache as a Service</a></li> 46<li><img alt="" src="/images/down.gif" /> <a href="#wincons">Running Apache as a Console Application</a></li> 47<li><img alt="" src="/images/down.gif" /> <a href="#test">Testing the Installation</a></li> 48<li><img alt="" src="/images/down.gif" /> <a href="#windrivemap">Configuring Access to Network Resources</a></li> 49</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 50<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 51<div class="section"> 52<h2><a name="req" id="req">Operating System Requirements</a></h2> 53 54 55 <p>The primary Windows platform for running Apache 2.4 is Windows 56 2000 or later. Always obtain and 57 install the current service pack to avoid operating system bugs.</p> 58 59 <div class="note">Apache HTTP Server versions later than 2.2 will not run on any 60 operating system earlier than Windows 2000.</div> 61 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 62<div class="section"> 63<h2><a name="down" id="down">Downloading Apache for Windows</a></h2> 64 65 66 <p>The Apache HTTP Server Project itself does not provide binary releases of 67 software, only source code. Individual committers <em>may</em> provide 68 binary packages as a convenience, but it is not a release deliverable.</p> 69 <p>If you cannot compile the Apache HTTP Server 70 yourself, you can obtain a binary package from numerous binary distributions 71 available on the Internet.</p> 72 73 <p>Popular options for deploying Apache httpd, and, optionally, PHP 74 and MySQL, on Microsoft Windows, include:</p> 75 <ul> 76 <li><a href="http://www.apachehaus.com/cgi-bin/download.plx">ApacheHaus</a></li> 77 <li><a href="http://www.apachelounge.com/download/">Apache Lounge</a></li> 78 <li><a href="http://bitnami.com/stack/wamp">BitNami WAMP Stack</a></li> 79 <li><a href="http://www.wampserver.com/">WampServer</a></li> 80 <li><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a></li> 81 </ul> 82 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 83<div class="section"> 84<h2><a name="cust" id="cust">Customizing Apache for Windows</a></h2> 85 86 87 <p>Apache is configured by the files in the <code>conf</code> 88 subdirectory. These are the same files used to configure the Unix 89 version, but there are a few different directives for Apache on 90 Windows. See the <a href="/mod/directives.html">directive index</a> 91 for all the available directives.</p> 92 93 <p>The main differences in Apache for Windows are:</p> 94 <ul> 95 <li><p>Because Apache for Windows is multithreaded, it does not 96 use a separate process for each request, as Apache can on Unix. 97 Instead there are usually only two Apache processes running: a 98 parent process, and a child which handles the requests. Within 99 the child process each request is handled by a separate thread. 100 </p> 101 102 <p>The process management directives are also different:</p> 103 104 <p><code class="directive"><a href="/mod/mpm_common.html#maxconnectionsperchild">MaxConnectionsPerChild</a></code>: 105 Like the Unix directive, this controls how many connections a single 106 child process will serve before exiting. 107 However, unlike on Unix, a replacement process is not instantly 108 available. Use the default <code>MaxConnectionsPerChild 0</code>, 109 unless instructed to change the behavior to overcome a memory leak 110 in third party modules or in-process applications.</p> 111 112 <div class="warning"><strong>Warning: The server configuration 113 file is reread when a new child process is started. If you have 114 modified <code>httpd.conf</code>, the new child may not start or 115 you may receive unexpected results.</strong></div> 116 117 <p><code class="directive"><a href="/mod/mpm_common.html#threadsperchild">ThreadsPerChild</a></code>: 118 This directive is new. It tells the server how many threads it 119 should use. This is the maximum number of connections the server 120 can handle at once, so be sure to set this number high enough for 121 your site if you get a lot of hits. The recommended default is 122 <code>ThreadsPerChild 150</code>, but this must be adjusted to 123 reflect the greatest anticipated number of simultaneous 124 connections to accept.</p></li> 125 126 <li><p>The directives that accept filenames as arguments must use 127 Windows filenames instead of Unix ones. However, because Apache 128 may interpret backslashes as an "escape character" sequence, you 129 should consistently use forward slashes in path names, not 130 backslashes.</p></li> 131 132 <li><p>While filenames are generally case-insensitive on 133 Windows, URLs are still treated internally as case-sensitive 134 before they are mapped to the filesystem. For example, the 135 <code class="directive"><a href="/mod/core.html#location"><Location></a></code>, 136 <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 137 case-sensitive arguments. For this reason, it is particularly 138 important to use the <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> directive when attempting 139 to limit access to content in the filesystem, since this 140 directive applies to any content in a directory, regardless of 141 how it is accessed. If you wish to assure that only lowercase 142 is used in URLs, you can use something like:</p> 143 144 <pre class="prettyprint lang-config">RewriteEngine On 145RewriteMap lowercase int:tolower 146RewriteCond %{REQUEST_URI} [A-Z] 147RewriteRule (.*) ${lowercase:$1} [R,L]</pre> 148</li> 149 150 <li><p>When running, Apache needs write access only to the logs 151 directory and any configured cache directory tree. Due to the 152 issue of case insensitive and short 8.3 format names, Apache must 153 validate all path names given. This means that each directory 154 which Apache evaluates, from the drive root up to the directory 155 leaf, must have read, list and traverse directory permissions. 156 If Apache2.4 is installed at C:\Program Files, then the root 157 directory, Program Files and Apache2.4 must all be visible 158 to Apache.</p></li> 159 160 <li><p>Apache for Windows contains the ability to load modules at 161 runtime, without recompiling the server. If Apache is compiled 162 normally, it will install a number of optional modules in the 163 <code>\Apache2.4\modules</code> directory. To activate these or 164 other modules, the <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code> 165 directive must be used. For example, to activate the status 166 module, use the following (in addition to the status-activating 167 directives in <code>access.conf</code>):</p> 168 169 <pre class="prettyprint lang-config">LoadModule status_module modules/mod_status.so</pre> 170 171 172 <p>Information on <a href="/mod/mod_so.html#creating">creating 173 loadable modules</a> is also available.</p></li> 174 175 <li><p>Apache can also load ISAPI (Internet Server Application 176 Programming Interface) extensions such as those used by Microsoft 177 IIS and other Windows servers. <a href="/mod/mod_isapi.html">More 178 information is available</a>. Note that Apache <strong>cannot</strong> 179 load ISAPI Filters, and ISAPI Handlers with some Microsoft feature 180 extensions will not work.</p></li> 181 182 <li><p>When running CGI scripts, the method Apache uses to find 183 the interpreter for the script is configurable using the 184 <code class="directive"><a href="/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</a></code> 185 directive.</p></li> 186 187 <li><p>Since it is often difficult to manage files with names 188 like <code>.htaccess</code> in Windows, you may find it useful to 189 change the name of this per-directory configuration file using 190 the <code class="directive"><a href="/mod/core.html#accessfilename">AccessFilename</a></code> 191 directive.</p></li> 192 193 <li><p>Any errors during Apache startup are logged into the 194 Windows event log when running on Windows NT. This mechanism 195 acts as a backup for those situations where Apache is not yet 196 prepared to use the <code>error.log</code> file. You can 197 review the Windows Application Event Log by using the Event Viewer, 198 e.g. Start - Settings - Control Panel - Administrative Tools 199 - Event Viewer.</p></li> 200 </ul> 201 202 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 203<div class="section"> 204<h2><a name="winsvc" id="winsvc">Running Apache as a Service</a></h2> 205 206 207 <p>Apache comes with a utility called the Apache Service Monitor. 208 With it you can see and manage the state of all installed Apache 209 services on any machine on your network. To be able to manage an 210 Apache service with the monitor, you have to first install the 211 service (either automatically via the installation or manually). 212 </p> 213 214 <p>You can install Apache as a Windows NT service as follows from 215 the command prompt at the Apache <code>bin</code> subdirectory:</p> 216 217 <div class="example"><p><code> 218 httpd.exe -k install 219 </code></p></div> 220 221 <p>If you need to specify the name of the service you want to 222 install, use the following command. You have to do this if you 223 have several different service installations of Apache on your 224 computer. If you specify a name during the install, you have to 225 also specify it during any other -k operation.</p> 226 227 <div class="example"><p><code> 228 httpd.exe -k install -n "MyServiceName" 229 </code></p></div> 230 231 <p>If you need to have specifically named configuration files for 232 different services, you must use this:</p> 233 234 <div class="example"><p><code> 235 httpd.exe -k install -n "MyServiceName" -f "c:\files\my.conf" 236 </code></p></div> 237 238 <p>If you use the first command without any special parameters except 239 <code>-k install</code>, the service will be called <code>Apache2.4</code> 240 and the configuration will be assumed to be <code>conf\httpd.conf</code>. 241 </p> 242 243 <p>Removing an Apache service is easy. Just use:</p> 244 245 <div class="example"><p><code> 246 httpd.exe -k uninstall 247 </code></p></div> 248 249 <p>The specific Apache service to be uninstalled can be specified by using:</p> 250 251 <div class="example"><p><code> 252 httpd.exe -k uninstall -n "MyServiceName" 253 </code></p></div> 254 255 <p>Normal starting, restarting and shutting down of an Apache 256 service is usually done via the Apache Service Monitor, by using 257 commands like <code>NET START Apache2.4</code> and <code>NET STOP 258 Apache2.4</code> or via normal Windows service management. Before 259 starting Apache as a service by any means, you should test the 260 service's configuration file by using:</p> 261 262 <div class="example"><p><code> 263 httpd.exe -n "MyServiceName" -t 264 </code></p></div> 265 266 <p>You can control an Apache service by its command line switches, 267 too. To start an installed Apache service you'll use this:</p> 268 269 <div class="example"><p><code> 270 httpd.exe -k start -n "MyServiceName" 271 </code></p></div> 272 273 <p>To stop an Apache service via the command line switches, use 274 this:</p> 275 276 <div class="example"><p><code> 277 httpd.exe -k stop -n "MyServiceName" 278 </code></p></div> 279 280 <p>or</p> 281 282 <div class="example"><p><code> 283 httpd.exe -k shutdown -n "MyServiceName" 284 </code></p></div> 285 286 <p>You can also restart a running service and force it to reread 287 its configuration file by using:</p> 288 289 <div class="example"><p><code> 290 httpd.exe -k restart -n "MyServiceName" 291 </code></p></div> 292 293 <p>By default, all Apache services are registered to run as the 294 system user (the <code>LocalSystem</code> account). The 295 <code>LocalSystem</code> account has no privileges to your network 296 via any Windows-secured mechanism, including the file system, named 297 pipes, DCOM, or secure RPC. It has, however, wide privileges locally. 298 </p> 299 300 <div class="warning"><strong>Never grant any network privileges to 301 the <code>LocalSystem</code> account! If you need Apache to be able 302 to access network resources, create a separate account for Apache as 303 noted below.</strong></div> 304 305 <p>It is recommended that users create a separate account for running 306 Apache service(s). If you have to access network resources via Apache, 307 this is required.</p> 308 309 <ol> 310 <li>Create a normal domain user account, and be sure to 311 memorize its password.</li> 312 313 <li>Grant the newly-created user a privilege of <code>Log on 314 as a service</code> and <code>Act as part of the operating 315 system</code>. On Windows NT 4.0 these privileges are granted via 316 User Manager for Domains, but on Windows 2000 and XP you probably 317 want to use Group Policy for propagating these settings. You can 318 also manually set these via the Local Security Policy MMC snap-in. 319 </li> 320 321 <li>Confirm that the created account is a member of the Users 322 group.</li> 323 324 <li>Grant the account read and execute (RX) rights to all document 325 and script folders (<code>htdocs</code> and <code>cgi-bin</code> 326 for example).</li> 327 328 <li>Grant the account change (RWXD) rights to the 329 Apache <code>logs</code> directory.</li> 330 331 <li>Grant the account read and execute (RX) rights to the 332 <code>httpd.exe</code> binary executable.</li> 333 </ol> 334 335 <div class="note">It is usually a good practice to grant the user the Apache 336 service runs as read and execute (RX) access to the whole Apache2.4 337 directory, except the <code>logs</code> subdirectory, where the 338 user has to have at least change (RWXD) rights.</div> 339 340 <p>If you allow the account to log in as a user and as a service, 341 then you can log on with that account and test that the account has 342 the privileges to execute the scripts, read the web pages, and that 343 you can start Apache in a console window. If this works, and you 344 have followed the steps above, Apache should execute as a service 345 with no problems.</p> 346 347 <div class="note"><strong>Error code 2186</strong> is a good indication that 348 you need to review the "Log On As" configuration for the service, 349 since Apache cannot access a required network resource. Also, pay 350 close attention to the privileges of the user Apache is 351 configured to run as.</div> 352 353 <p>When starting Apache as a service you may encounter an error 354 message from the Windows Service Control Manager. For example, 355 if you try to start Apache by using the Services applet in the 356 Windows Control Panel, you may get the following message:</p> 357 358 <div class="example"><p><code> 359 Could not start the Apache2.4 service on \\COMPUTER <br /> 360 Error 1067; The process terminated unexpectedly. 361 </code></p></div> 362 363 <p>You will get this generic error if there is any problem with 364 starting the Apache service. In order to see what is really causing 365 the problem you should follow the instructions for Running Apache 366 for Windows from the Command Prompt.</p> 367 368 <p>If you are having problems with the service, it is suggested 369 you follow the instructions below to try starting httpd.exe from 370 a console window, and work out the errors before struggling to 371 start it as a service again.</p> 372 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 373<div class="section"> 374<h2><a name="wincons" id="wincons">Running Apache as a Console Application</a></h2> 375 376 377 <p>Running Apache as a service is usually the recommended way to 378 use it, but it is sometimes easier to work from the command line, 379 especially during initial configuration and testing.</p> 380 381 <p>To run Apache from the command line as a console application, 382 use the following command:</p> 383 384 <div class="example"><p><code> 385 httpd.exe 386 </code></p></div> 387 388 <p>Apache will execute, and will remain running until it is stopped 389 by pressing Control-C.</p> 390 391 <p>You can also run Apache via the shortcut Start Apache in Console 392 placed to <code>Start Menu --> Programs --> Apache HTTP Server 393 2.4.xx --> Control Apache Server</code> during the installation. 394 This will open a console window and start Apache inside it. If you 395 don't have Apache installed as a service, the window will remain 396 visible until you stop Apache by pressing Control-C in the console 397 window where Apache is running in. The server will exit in a few 398 seconds. However, if you do have Apache installed as a service, the 399 shortcut starts the service. If the Apache service is running 400 already, the shortcut doesn't do anything.</p> 401 402 <p>If Apache is running as a service, you can tell it to stop by opening another console 403 window and entering:</p> 404 405 <div class="example"><p><code> 406 httpd.exe -k shutdown 407 </code></p></div> 408 409 <p>Running as a service should be preferred over running in a 410 console window because this lets Apache end any current operations 411 and clean up gracefully.</p> 412 413 <p>But if the server is running in a console window, you can 414 only stop it by pressing Control-C in the same window.</p> 415 416 <p>You can also tell Apache to restart. This forces it to reread 417 the configuration file. Any operations in progress are allowed to 418 complete without interruption. To restart Apache, either press 419 Control-Break in the console window you used for starting Apache, 420 or enter</p> 421 422 <div class="example"><p><code> 423 httpd.exe -k restart 424 </code></p></div> 425 426 <p>if the server is running as a service.</p> 427 428 <div class="note">Note for people familiar with the Unix version of Apache: 429 these commands provide a Windows equivalent to <code>kill -TERM 430 <em>pid</em></code> and <code>kill -USR1 <em>pid</em></code>. The 431 command line option used, <code>-k</code>, was chosen as a reminder 432 of the <code>kill</code> command used on Unix.</div> 433 434 <p>If the Apache console window closes immediately or unexpectedly 435 after startup, open the Command Prompt from the Start Menu --> 436 Programs. Change to the folder to which you installed Apache, type 437 the command <code>httpd.exe</code>, and read the error message. Then 438 change to the logs folder, and review the <code>error.log</code> 439 file for configuration mistakes. Assuming httpd was installed into 440 <code>C:\Program Files\Apache Software Foundation\Apache2.4\</code>, 441 you can do the following:</p> 442 443 <div class="example"><p><code> 444 c: <br /> 445 cd "\Program Files\Apache Software Foundation\Apache2.4\bin" <br /> 446 httpd.exe 447 </code></p></div> 448 449 <p>Then wait for Apache to stop, or press Control-C. Then enter the 450 following:</p> 451 452 <div class="example"><p><code> 453 cd ..\logs <br /> 454 more < error.log 455 </code></p></div> 456 457 <p>When working with Apache it is important to know how it will 458 find the configuration file. You can specify a configuration file 459 on the command line in two ways:</p> 460 461 <ul> 462 <li><p><code>-f</code> specifies an absolute or relative path to 463 a particular configuration file:</p> 464 465 <div class="example"><p><code> 466 httpd.exe -f "c:\my server files\anotherconfig.conf" 467 </code></p></div> 468 469 <p>or</p> 470 471 <div class="example"><p><code> 472 httpd.exe -f files\anotherconfig.conf 473 </code></p></div></li> 474 475 <li><p><code>-n</code> specifies the installed Apache service 476 whose configuration file is to be used:</p> 477 478 <div class="example"><p><code> 479 httpd.exe -n "MyServiceName" 480 </code></p></div> 481 </li> 482 </ul> 483 484 <p>In both of these cases, the proper 485 <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> should be set in 486 the configuration file.</p> 487 488 <p>If you don't specify a configuration file with <code>-f</code> 489 or <code>-n</code>, Apache will use the file name compiled into the 490 server, such as <code>conf\httpd.conf</code>. This built-in path 491 is relative to the installation directory. You can verify the compiled 492 file name from a value labelled as <code>SERVER_CONFIG_FILE</code> when 493 invoking Apache with the <code>-V</code> switch, like this:</p> 494 495 <div class="example"><p><code> 496 httpd.exe -V 497 </code></p></div> 498 499 <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> 500 501 <ol> 502 <li>A <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> directive 503 via the <code>-C</code> command line switch.</li> 504 505 <li>The <code>-d</code> switch on the command line.</li> 506 507 <li>Current working directory.</li> 508 509 <li>A registry entry which was created if you did a binary 510 installation.</li> 511 512 <li>The server root compiled into the server. This is <code> 513 /apache</code> by default, you can verify it by using <code> 514 httpd.exe -V</code> and looking for a value labelled as 515 <code>HTTPD_ROOT</code>.</li> 516 </ol> 517 518 <p>If you did not do a binary install, Apache will in some 519 scenarios complain about the missing registry key. This warning can 520 be ignored if the server was otherwise able to find its 521 configuration file.</p> 522 523 <p>The value of this key is the 524 <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> directory which 525 contains the <code>conf</code> subdirectory. When Apache starts it 526 reads the <code>httpd.conf</code> file from that directory. If 527 this file contains a <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> 528 directive which contains a different directory from the one 529 obtained from the registry key above, Apache will forget the 530 registry key and use the directory from the configuration file. If 531 you copy the Apache directory or configuration files to a new 532 location it is vital that you update the 533 <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> directive in the 534 <code>httpd.conf</code> file to reflect the new location.</p> 535 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 536<div class="section"> 537<h2><a name="test" id="test">Testing the Installation</a></h2> 538 539 540 <p>After starting Apache (either in a console window or as a 541 service) it will be listening on port 80 (unless you changed the 542 <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> directive in the 543 configuration files or installed Apache only for the current user). 544 To connect to the server and access the default page, launch a 545 browser and enter this URL:</p> 546 547 <div class="example"><p><code> 548 http://localhost/ 549 </code></p></div> 550 551 <p>Apache should respond with a welcome page and you should see 552 "It Works!". If nothing happens or you get an error, look in the 553 <code>error.log</code> file in the <code>logs</code> subdirectory. 554 If your host is not connected to the net, or if you have serious 555 problems with your DNS (Domain Name Service) configuration, you 556 may have to use this URL:</p> 557 558 <div class="example"><p><code> 559 http://127.0.0.1/ 560 </code></p></div> 561 562 <p>If you happen to be running Apache on an alternate port, you 563 need to explicitly put that in the URL:</p> 564 565 <div class="example"><p><code> 566 http://127.0.0.1:8080/ 567 </code></p></div> 568 569 <p>Once your basic installation is working, you should configure it 570 properly by editing the files in the <code>conf</code> subdirectory. 571 Again, if you change the configuration of the Windows NT service 572 for Apache, first attempt to start it from the command line to 573 make sure that the service starts with no errors.</p> 574 575 <p>Because Apache <strong>cannot</strong> share the same port with 576 another TCP/IP application, you may need to stop, uninstall or reconfigure 577 certain other services before running Apache. These conflicting 578 services include other WWW servers, some firewall implementations, 579 and even some client applications (such as Skype) which will use port 580 80 to attempt to bypass firewall issues.</p> 581 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 582<div class="section"> 583<h2><a name="windrivemap" id="windrivemap">Configuring Access to Network Resources</a></h2> 584 585 586 <p>Access to files over the network can be specified using two 587 mechanisms provided by Windows:</p> 588 589 <dl> 590 <dt>Mapped drive letters</dt> 591 <dd>e.g., <code>Alias /images/ Z:/</code></dd> 592 593 <dt>UNC paths</dt> 594 <dd>e.g., <code>Alias /images/ //imagehost/www/images/</code></dd> 595 </dl> 596 597 <p>Mapped drive letters allow the administrator to maintain the 598 mapping to a specific machine and path outside of the Apache httpd 599 configuration. However, these mappings are associated only with 600 interactive sessions and are not directly available to Apache httpd 601 when it is started as a service. <strong>Use only UNC paths for 602 network resources in httpd.conf</strong> so that the resources can 603 be accessed consistently regardless of how Apache httpd is started. 604 (Arcane and error prone procedures may work around the restriction 605 on mapped drive letters, but this is not recommended.)</p> 606 607 <div class="example"><h3>Example DocumentRoot with UNC path</h3><pre class="prettyprint lang-config">DocumentRoot //dochost/www/html/</pre> 608</div> 609 610 <div class="example"><h3>Example DocumentRoot with IP address in UNC path</h3><pre class="prettyprint lang-config">DocumentRoot //192.168.1.50/docs/</pre> 611</div> 612 613 <div class="example"><h3>Example Alias and corresponding Directory with UNC path</h3><pre class="prettyprint lang-config">Alias /images/ //imagehost/www/images/ 614 615<Directory //imagehost/www/images/> 616#... 617<Directory></pre> 618</div> 619 620 <p>When running Apache httpd as a service, you must create a 621 separate account in order to access network resources, as described 622 above.</p> 623 </div></div> 624<div class="bottomlang"> 625<p><span>Available Languages: </span><a href="/en/platform/windows.html" title="English"> en </a> | 626<a href="/fr/platform/windows.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 627<a href="/ko/platform/windows.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 628</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 629<script type="text/javascript"><!--//--><![CDATA[//><!-- 630var comments_shortname = 'httpd'; 631var comments_identifier = 'http://httpd.apache.org/docs/2.4/platform/windows.html'; 632(function(w, d) { 633 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 634 d.write('<div id="comments_thread"><\/div>'); 635 var s = d.createElement('script'); 636 s.type = 'text/javascript'; 637 s.async = true; 638 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 639 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 640 } 641 else { 642 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 643 } 644})(window, document); 645//--><!]]></script></div><div id="footer"> 646<p class="apache">Copyright 2014 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> 647<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 648if (typeof(prettyPrint) !== 'undefined') { 649 prettyPrint(); 650} 651//--><!]]></script> 652</body></html>