From 660f77c28fe11534139e8d9ecda2d573921fa8dd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Jul 2014 16:40:11 -0400 Subject: propellor spin --- src/Propellor/Property/Apache.hs | 16 ++++++++++++++ src/Propellor/Property/SiteSpecific/JoeySites.hs | 27 ++++++++---------------- 2 files changed, 25 insertions(+), 18 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index a8014999..e6930893 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 40e1bead..51d3d60c 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" -- cgit v1.2.3