Opened 10 months ago

#13366 new Patch - Feature

Mythweb - Safely implement recommended best practices

Reported by: Gary Buhrmaster Owned by: Stuart Auchterlonie
Priority: minor Milestone: needs_triage
Component: Plugin - MythWeb Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Reviewing some old stashes, I found this one. It may be of interest to the mythweb users. It tries to implement the recommended configurations using safe definitions in the default apache config. Caveat emptor.

diff --git a/mythweb.conf.apache b/mythweb.conf.apache
index cc81c3ff..c5da6061 100644
--- a/mythweb.conf.apache
+++ b/mythweb.conf.apache
@@ -212,6 +212,16 @@
     #    AddOutputFilterByType DEFLATE text/css
     #    AddOutputFilterByType DEFLATE application/x-javascript
 
+    # if we can auto-detect the deflate module, use it
+        <IfModule deflate_module>
+            BrowserMatch ^Mozilla/4 gzip-only-text/html
+            BrowserMatch ^Mozilla/4\.0[678] no-gzip
+            BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
+            AddOutputFilterByType DEFLATE text/html
+            AddOutputFilterByType DEFLATE text/css
+            AddOutputFilterByType DEFLATE application/x-javascript
+        </IfModule>
+
     # This is helpful for mod_deflate -- it prevents proxies from changing
     # the user agent to/from this server, which can prevent compression from
     # being enabled.  It is disabled here because many distros seem not to
@@ -219,6 +229,11 @@
     #
     #    Header append Vary User-Agent env=!dont-vary
 
+    # If we can auto-detect the headers module, use it
+        <IfModule headers_module>
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+
     # Set up the perl handler so we can stream properly.  Do not use mod_perl
     # because it has a tendency to hold onto child processes, which causes
     # problems if the browser closes on an in-progress stream.

Change History (0)

Note: See TracTickets for help on using tickets.