]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/apache.erb
Only allow access to export from known caches
[chef.git] / cookbooks / tile / templates / default / apache.erb
index 4fcbf9b478a16d66b08a8d4710d823fd7c7c385b..fbc781c90bf86714a39c2593f7ab496c09e16803 100644 (file)
@@ -22,7 +22,8 @@
 <% end -%>
 
   # Setup logging
-  CustomLog /var/log/apache2/access.log combined
+  LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_with_remoteip
+  CustomLog /var/log/apache2/access.log combined_with_remoteip
   ErrorLog /var/log/apache2/error.log
   BufferedLogs on
 
   AllowOverride None
   Require all granted
 </Directory>
+
+<Location /cgi-bin/export>
+<% @caches.each do |cache| -%>
+<% cache.ipaddresses(:role => :external).sort.each do |address| -%>
+  Require ip <%= address %>
+<% end -%>
+<% end -%>
+</Location>