From cc1ed896cbae702e697f21d02896df4ac433aa96 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Fri, 18 Oct 2024 14:27:47 +0200 Subject: [PATCH] Kapitel 14: DAV & deflate --- conf/kapitel/kapitel_14.conf | 92 ++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 conf/kapitel/kapitel_14.conf diff --git a/conf/kapitel/kapitel_14.conf b/conf/kapitel/kapitel_14.conf new file mode 100644 index 0000000..65ec116 --- /dev/null +++ b/conf/kapitel/kapitel_14.conf @@ -0,0 +1,92 @@ +##### Kapitel 14: WebDAV + +### Allgemein/Immer + +LoadModule dav_module modules/mod_dav.so +LoadModule dav_fs_module modules/mod_dav_fs.so +LoadModule dav_lock_module modules/mod_dav_lock.so + +DavLockDB /tmp/dav.lock + +### WebDAV ohne SSL und ohne Auth + + + DocumentRoot /usr/local/apache2/htdocs-webdav.sv + ServerName webdav.sv + + CustomLog logs/webdav-access.log combined + ErrorLog logs/webdav-error.log + + + Dav On + + + +### WebDAV mit SSL und Digest-Auth je Gruppe + + + SSLEngine On + SSLCertificateFile "/usr/local/apache2/conf/ssl/localhost.crt" + SSLCertificateKeyFile "/usr/local/apache2/conf/ssl/localhost.key" + + DocumentRoot /usr/local/apache2/htdocs-webdav.sv + ServerName webdav.sv + + CustomLog logs/webdav_SSL-access.log combined + ErrorLog logs/webdav_SSL-error.log + + + AuthType Digest + AuthName "WebDAV" + AuthUserFile /usr/local/apache2/htdigest.users + AuthGroupFile /usr/local/apache2/htgroups.webdav + + + Require group ro rw + + + + Require group rw + + + Dav On + + + + +##### Kapitel 14: Komprimierte Auslieferung + +### mod_deflate aka "Accept-Encoding: gzip" + +LoadModule deflate_module modules/mod_deflate.so + +# Das meiste per Brotli +# AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json +AddOutputFilterByType DEFLATE text/xml application/json +# Schlechte Beispiele: +AddOutputFilterByType DEFLATE application/x-font-ttf application/vnd.ms-fontobject image/x-icon +DeflateFilterNote Input deflate_input_info +DeflateFilterNote Output deflate_output_info +DeflateFilterNote Ratio deflate_ratio_info + +LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate_compress +CustomLog "|bin/rotatelogs logs/deflate_log.%Y%m%d 86400" deflate_compress + + +### mod_brotli aka "Accept-Encoding: br" + +LoadModule brotli_module modules/mod_brotli.so + +AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/css text/javascript application/x-javascript application/javascript +# per gzip: +# AddOutputFilterByType BROTLI_COMPRESS text/xml application/json + +BrotliFilterNote Input brotli_input_info +BrotliFilterNote Output brotli_output_info +BrotliFilterNote Ratio brotli_ratio_info + +LogFormat '"%r" %{brotli_output_info}n/%{brotli_input_info}n (%{brotli_ratio_info}n%%)' brotli_compress +CustomLog logs/brotli.log brotli_compress + +# https://bytepursuits.com/apache-enabling-brotli-compression-with-gzip-deflate-fallback +