title: Apache: Directory index forbidden by Options directive
body: <p>We are running 4 Wordpress network installations on a Windows Server 2008 R2 VPS, with Apache 2.2.17 and PHP 5.3.10 and for some reason we are <strong>regularly</strong> getting this (sample) error:</p>
  
  <p><strong>Error log</strong></p>
  
  <pre><code>[Thu Feb 16 15:01:59 2012] [error] [client x.x.x.x] Directory index forbidden by Options directive: C:/_webserver/_www/wp/www/
  </code></pre>
  
  <p><strong>Access log</strong></p>
  
  <pre><code>host x.x.x.x - - [17/Feb/2012:12:59:23 +0200] "GET / HTTP/1.1" 403 306 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.2; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; MATM)"
  </code></pre>
  
  <p>The error "Directory index forbidden" usually means that a directory is trying to be accessed, but there is no file (according to the options directive) to be displayed and directory listing is forbidden. This however is not the case here. The error refers to the folder <code>C:/_webserver/_www/wp/www/</code>, which is the webroot for the project, and has always had an <code>index.php</code>. Also, <code>httpd.conf</code> is set-up with: <code>DirectoryIndex index.html index.php</code></p>
  
  <p>Seeing as how the error occurs in Apache, I think it's highly unlikely that this can be caused by either PHP or Wordpress.</p>
  
  <p>The tough thing is that we don't know how to reproduce the error, so it is hard for us to test this.</p>
  
  <p>What can we do to find out what the issue could be? Can it have anything to do with the set-up  of Apache (seems like a redundant question). Can it have anything to do with the file already being read by Apache? Is there some way we can get more info about this issue?</p>
  
  <p>I would welcome any help to help me solve this nasty case.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>These are the modules that I currently have in use</p>
  
  <pre><code>LoadModule deflate_module modules/mod_deflate.so
  LoadModule expires_module modules/mod_expires.so
  LoadModule headers_module modules/mod_headers.so
  LoadModule cache_module modules/mod_cache.so
  
  LoadModule rewrite_module modules/mod_rewrite.so
  LoadModule setenvif_module modules/mod_setenvif.so
  LoadModule vhost_alias_module modules/mod_vhost_alias.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule authz_host_module modules/mod_authz_host.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule php5_module "c:/_webserver/_server/php-5.3.10-Win32-VC9-x86/php5apache2_2.dll"
  </code></pre>
  
  <p>Options directives:</p>
  
  <pre><code>&lt;Directory /&gt;
      Options FollowSymLinks ExecCGI
      AllowOverride None
      Order deny,allow
      Allow from all
  &lt;/Directory&gt;
  
  &lt;Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cgi-bin"&gt;
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>httpd-vhosts.conf looks like this:</p>
  
  <pre><code>NameVirtualHost *:80
  
  &lt;VirtualHost *:80&gt;
  
    &lt;Directory "C:/_webserver/_www/sites/www"&gt;
  
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
  
    &lt;/Directory&gt;
    Include "C:/_webserver/_www/sites/htaccess.conf"
  
    DocumentRoot "C:/_webserver/_www/sites/www"
    ServerName xxx
    ServerAlias xxx
    CustomLog logs/sites.access.log mycombined
    ErrorLog logs/sites.error.log 
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have 5 virtual hosts set-up like this, with each their own error and access log. The projects don't use a <code>.htaccess</code>, but this is set-up statically via the conf for performance.</p>
  
  <p>The server runs on windows, so the MPM set-up is a little limited</p>
  
  <pre><code># WinNT MPM
  # ThreadsPerChild: constant number of worker threads in the server process
  # MaxRequestsPerChild: maximum  number of requests a server process serves
  &lt;IfModule mpm_winnt_module&gt;
      ThreadsPerChild       1750
      MaxRequestsPerChild    0
  &lt;/IfModule&gt;
  </code></pre>
  
  <p><strong>Final update</strong></p>
  
  <p>Well, I decided to turn off Apache caching completely, and since then, had no more errors. Unfortunately I haven't had too much time this week to do proper testing, but at least I know where the issue lies. And with a not so busy server, no caching is alright for now. I might be back in a while :-)</p>