Opened 18 months ago

Closed 4 months ago

Last modified 4 months ago

#13366 closed Patch - Feature (fixed)

Mythweb - Safely implement recommended best practices

Reported by: Gary Buhrmaster Owned by: Stuart Auchterlonie
Priority: minor Milestone: 31.0
Component: Plugin - MythWeb Version: Master Head
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 (2)

comment:1 Changed 4 months ago by Stuart Auchterlonie <stuarta@…>

Resolution: fixed
Status: newclosed

In 37bf52585/mythweb:

Fixes #13366 - Update apache conf with some recommendations

comment:2 Changed 4 months ago by Stuart Auchterlonie

Milestone: needs_triage31.0
Version: UnspecifiedMaster Head
Note: See TracTickets for help on using tickets.