在单独的驱动器上的Apache mod_disk_cache

我怎样才能设置Apache的mod_disk_cache在一个单独的驱动器从OS / Apache的安装位置?

我已经在我的apache2.conf上设置了这个:

<IfModule mod_cache_disk.c> # cache cleaning is done by htcacheclean, which can be configured in # /etc/default/apache2 # # For further information, see the comments in that file, # /usr/share/doc/apache2/README.Debian, and the htcacheclean(8) # man page. # This path must be the same as the one in /etc/default/apache2 CacheRoot /media/cacheHD # This will also cache local documents. It usually makes more sense to # put this into the configuration for just one virtual host. CacheEnable disk / # The result of CacheDirLevels * CacheDirLength must not be higher than # 20. Moreover, pay attention on file system limits. Some file systems # do not support more than a certain number of inodes and # subdirectories (eg 32000 for ext3) CacheDirLevels 2 CacheDirLength 1 </IfModule> 

它似乎并没有caching任何东西。 该驱动器本身是一个新的安装ssd驱动器格式化ext4。

加载disk storage manager module之前,模块mod_cache本身必须被加载,并且在尝试configuration它们之前必须加载模块。

您可以确认所有正确的模块是否加载:

 apachectl -t -D DUMP_MODULES 

也许你复制了一个不完整的configuration,但以下更完整:

 LoadModule cache_module modules/mod_cache.so <IfModule mod_cache.c> # If you want to use mod_disk_cache : LoadModule disk_cache_module modules/mod_disk_cache.so <IfModule mod_cache_disk.c> # settings for mod_disk_cache CacheRoot /media/cacheHD CacheEnable disk / CacheDirLevels 2 CacheDirLength 1 </IfModule> </IfModule>