title: Windows XP: Add site directory to Apache config
body: <p>I have a local instance of Apache on my computer for development purposes, I'm trying to add a site directory, to Apache's httpconf file, that contains some sample web applications I'm trying to debug using Eclipse.  The directory I'm trying to add is as follows:</p>
  
  <p><strong>C:\Eclipse_Workspace\dummyWeb</strong></p>
  
  <p>After adding the path, I restarted Apache and tried to enter a URL as :</p>
  
  <pre><code>http://localhost/Eclipse_Workspace/dummyWeb/enterGreeting.php
  </code></pre>
  
  <p>But I get the 404 error page.  I'm not sure what I have to do to to get the page to open properly.  I'm new to Apache server configuration and am using ApacheConf Lite as a GUI-based server settings editor.  The new directory I added in the httpconf file looks like this:</p>
  
  <pre><code>&lt;Directory "C:\Eclipse_Workspace\dummyWeb"&gt;
    Options All
    Allow from All
    Order Allow,Deny
    AllowOverride None
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I also tried making the last slash a forward slash like the default root directory: </p>
  
  <pre><code>&lt;Directory "C:\Eclipse_Workspace/dummyWeb"&gt;
    Options All
    Allow from All
    Order Allow,Deny
    AllowOverride None
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Compared to the default root:</p>
  
  <pre><code>&lt;Directory "C:\Program Files\Zend\Apache2/htdocs"&gt;
    # 
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # 
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    # 
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    Options FollowSymLinks Indexes
    # 
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    Allow from all
    # 
    # Controls who can get stuff from this server.
    Order allow,deny
    AllowOverride None
    # 
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    # 
    # 
    # This should be changed to whatever you set DocumentRoot to.
  &lt;/Directory&gt;
  </code></pre>
  
  <p>But I still get 404, what am I missing?  Any help is appreciated.</p>
  
  <p>Some other details, I'm using the Zend Server Community Edition for PHP web development and Eclipse with PDT. My goal is to be able to debug PHP web applications through Eclipse.</p>
  
  <p>UPDATE:</p>
  
  <p>Looks like adding an alias might be what I'm looking for.  Not sure how they work though, currently reading through Apache documentation.</p>
  
  <p>UPDATE 2:</p>
  
  <p>Bingo!  Looks like adding an alias did the trick.  The relevant lines of configuration are as follows:</p>
  
  <pre><code># DocumentRoot: The directory out of which you will serve your
  # documents. By default, all requests are taken from this directory, but
  # symbolic links and aliases may be used to point to other locations.
  DocumentRoot "C:\Program Files\Zend\Apache2/htdocs"
  
  .
  
  .
  
  .
  
  .
  
  &lt;IfModule alias_module&gt;
    # 
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar
    # 
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    Alias /webpath "C:/Eclipse_Workspace/dummyWeb/"
    &lt;Directory "C:/Eclipse_Workspace/dummyWeb/"&gt;
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    &lt;/Directory&gt;
    # 
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a &lt;Directory&gt; section to allow access to
    # the filesystem path.
    # 
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    ScriptAlias /cgi-bin/ "C:\Program Files\Zend\Apache2/cgi-bin/"
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>So if I punch in the following URL: <code>http://localhost/webpath/</code>, I'll get a directory listing as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/6DaKT.png" alt="enter image description here"></p>
  
  <p>Brandon, thanks for the suggestion.  I want to keep the document root intact, I'm going to modify the alias to move up one directory, i.e. <strong>C:/Eclipse_Workspace/</strong> so that I have access to debug all my web applications in the eclipse workspace.  This <a href="http://www.nodans.com/index.cfm/2006/10/10/Apache-Directory-Aliases-and-Virtual-Directories" rel="nofollow noreferrer">link</a> also provided a good tip on a potential Gotcha when adding an alias.</p>
  
  <p>Last, but not least, for anyone interested in setting up a simple PHP Development environment, <a href="http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf" rel="nofollow noreferrer">this</a> PDF document proved a very valuable resource, make sure to follow the instructions.  I used the all-in-one package tools provided on <a href="http://www.zend.com/en/community/pdt" rel="nofollow noreferrer">Zend's website</a>, they pretty much come with everything out of the box.</p>