httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Ingvoldstad <>
Subject [users@httpd] mod_disk_cache: File list occasionally displayed instead of index.php (suhosin, suphp, mod_cache, mod_security)
Date Fri, 11 Nov 2011 09:57:45 GMT

I have a frustrating problem, which I'm not quite able to debug properly.

I have a webserver running Apache 2.2.21 compiled as worker-MPM with a
suhosin PHP 5.2.17 (using "phpize", not patching)
under suphp 0.7.1, with mod_security 2.6.1 and modsecurity_crs 2.2.1
plus modsecurity_flameeyes.

Some virtualhosts on this server are configured with mod_disk_cache,
and every once in a while, instead of loading index.php, the list of
files in the directory is loaded instead. If I disable mod_disk_cache,
everything works as expected. It also appears to work as expected with
mod_mem_cache. I want to use disk caching, however, as that seems to
be the better solution.

Reproducing the bug is a bit of a PITA, as the bug appears apparently
at random, and only rarely.

It appears as if <IfModule mod_suphp.c> or <IfModule dir_module>
fails, since DirectoryIndex does not contain index.php unless both of
these tests succeeds.

Has anyone seen similar problems?

Here is an example of a bugging virtualhost config:

<VirtualHost CENSORED:80>
  ServerAdmin CENSORED
  ServerName CENSORED
  DocumentRoot CENSORED

  <IfModule mod_cache.c>
    <IfModule !mod_disk_cache.c>
      LoadModule disk_cache_module modules/
    <IfModule mod_disk_cache.c>
      CacheEnable disk /
      CacheRoot /var/cache/apache2/caches/2va0Vx98
      CacheMinFileSize 64
      CacheMaxFileSize 500000

  <IfModule mod_suphp.c>
    <IfModule dir_module>
      DirectoryIndex index.cgi index.php index.shtml index.html
index.htm index.wml index.pdf
    SetEnv PHPRC /usr/local/php5.2-suphp/lib/
    suPHP_Engine on
    suPHP_ConfigPath /usr/local/php5.2-suphp/lib/
    AddHandler x-httpd-php .php
    AddHandler x-httpd-php .php5
    <Directory />
      suPHP_AddHandler x-httpd-php

Replacing the caching section with the following seems to work nicely:

  <IfModule mod_cache.c>
    <IfModule !mod_mem_cache.c>
      LoadModule mem_cache_module modules/
    <IfModule mod_mem_cache.c>
      CacheEnable mem /
      MCacheSize 4096
      MCacheMaxObjectCount 1009
      MCacheMaxObjectSize 500000


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message