Improve mod_disk_cache support
authorClinton Ebadi <clinton@unknownlamer.org>
Fri, 2 May 2014 03:33:09 +0000 (23:33 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Fri, 2 May 2014 03:33:09 +0000 (23:33 -0400)
* Removed htcacheclean cron job since apache used cache cleaning daemon
* Set size of disk cache to 1G instead of 300M
* Allow files up to ~15M to be cached

debian/hcoop-apache-clean-cache [deleted file]
debian/hcoop-apache2-config.displace
debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d [deleted file]
debian/hcoop-apache2-config.transform [new file with mode: 0644]
debian/rules
files/mods-available/disk_cache.conf.hcoop [new file with mode: 0644]

diff --git a/debian/hcoop-apache-clean-cache b/debian/hcoop-apache-clean-cache
deleted file mode 100644 (file)
index b9a2cd0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# /etc/cron.d/hcoop-apache-clean-cache: Clean the disk cache every 23
-# minutes.
-MAILTO=logs@mire.hcoop.net
-
-*/23 * * * * root /usr/sbin/htcacheclean -n -t -p/var/cache/apache2/mod_disk_cache -l700M
index 2196412..115d7b4 100644 (file)
@@ -2,3 +2,4 @@
 /etc/suphp/suphp.conf.hcoop
 /etc/apache2/mods-available/suphp.conf.hcoop
 /etc/apache2/mods-available/status.conf.hcoop
+/etc/apache2/mods-available/disk_cache.conf.hcoop
diff --git a/debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d b/debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d
deleted file mode 100644 (file)
index 03658a3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# /etc/cron.d/hcoop-apache-sync-logs: Copy apache logs to user
-# homedirs every 20 minutes.
-MAILTO=logs@hcoop.net
-
-0 */2 * * * root /afs/hcoop.net/common/etc/scripts/apache-sync-logs >/dev/null 2>&1
diff --git a/debian/hcoop-apache2-config.transform b/debian/hcoop-apache2-config.transform
new file mode 100644 (file)
index 0000000..32cd06a
--- /dev/null
@@ -0,0 +1 @@
+/etc/default/apache2.hcoop sed -e 's/^HTCACHECLEAN_SIZE=.*/HTCACHECLEAN_SIZE=1G/'
\ No newline at end of file
index b8f94e9..4b25e40 100755 (executable)
@@ -12,6 +12,3 @@
 %:
        dh $@ --with=config-package
 
-override_dh_installcron:
-       dh_installcron --name=hcoop-apache-sync-logs
-
diff --git a/files/mods-available/disk_cache.conf.hcoop b/files/mods-available/disk_cache.conf.hcoop
new file mode 100644 (file)
index 0000000..ca77951
--- /dev/null
@@ -0,0 +1,22 @@
+<IfModule mod_disk_cache.c>
+# cache cleaning is done by htcacheclean, which can be configured in
+# /etc/default/apache2
+
+        # This path must be the same as the one in /etc/default/apache2
+        CacheRoot /var/cache/apache2/mod_disk_cache
+
+        # 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 subdirectories in a
+        # single directory (e.g. 32000 for ext3)
+        CacheDirLevels 2
+        CacheDirLength 1
+
+       # cache files up to ~15M
+       CacheMaxFileSize 17000000
+</IfModule>