diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs
index a801499..e693089 100644
--- a/src/Propellor/Property/Apache.hs
+++ b/src/Propellor/Property/Apache.hs
@@ -68,3 +68,19 @@ multiSSL = "/etc/apache2/conf.d/ssl" `File.hasContent`
]
`describe` "apache SNI enabled"
`onChange` reloaded
+
+-- | Config file fragment that can be inserted into a
+-- stanza to allow global read access to the directory.
+--
+-- Works with multiple versions of apache that have different ways to do
+-- it.
+allowAll :: String
+allowAll = unlines
+ [ ""
+ , "Order allow,deny"
+ , "allow from all"
+ , ""
+ , "= 2.4>"
+ , "Require all granted"
+ , ""
+ ]
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index 40e1bea..51d3d60 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -61,9 +61,7 @@ oldUseNetServer hosts = propertyList ("olduse.net server")
, " "
, " Options Indexes FollowSymlinks"
, " AllowOverride None"
- -- I had this in the file before.
- -- This may be needed by a newer version of apache?
- --, " Require all granted"
+ , Apache.allowAll
, " "
]
]
@@ -578,9 +576,7 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " Options Indexes FollowSymLinks MultiViews ExecCGI Includes"
, " AllowOverride None"
- , " Order allow,deny"
- , " allow from all"
- , " Require all granted"
+ , Apache.allowAll
, ""
, "ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/"
@@ -588,24 +584,19 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " AllowOverride None"
, " Options ExecCGI"
- , " Order allow,deny"
- , " allow from all"
+ , Apache.allowAll
, ""
, "Alias /pipermail/ /var/lib/mailman/archives/public/"
, ""
, " Options Indexes MultiViews FollowSymlinks"
, " AllowOverride None"
- , " Order allow,deny"
- , " Allow from all"
- , " Require all granted"
+ , Apache.allowAll
, ""
, "Alias /images/ /usr/share/images/"
, ""
, " Options Indexes MultiViews"
, " AllowOverride None"
- , " Order allow,deny"
- , " Allow from all"
- , " Require all granted"
+ , Apache.allowAll
, ""
, "RewriteEngine On"
@@ -672,7 +663,7 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " Options Indexes ExecCGI"
, " AllowOverride None"
- , " Require all granted"
+ , Apache.allowAll
, ""
]
, alias "sows-ear.kitenet.net"
@@ -683,7 +674,7 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " Options FollowSymLinks"
, " AllowOverride None"
- , " Require all granted"
+ , Apache.allowAll
, ""
]
, alias "wortroot.kitenet.net"
@@ -694,7 +685,7 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " Options FollowSymLinks"
, " AllowOverride None"
- , " Require all granted"
+ , Apache.allowAll
, ""
]
, alias "joey.kitenet.net"
@@ -703,7 +694,7 @@ legacyWebSites = propertyList "legacy web sites"
, ""
, " Options Indexes ExecCGI"
, " AllowOverride None"
- , " Require all granted"
+ , Apache.allowAll
, ""
, "RewriteEngine On"