nominatim: move apache log into nominatim logdir
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 1 Oct 2017 19:06:33 +0000 (21:06 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 1 Oct 2017 19:06:33 +0000 (21:06 +0200)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/apache.erb
cookbooks/nominatim/templates/default/logrotate.apache.erb
cookbooks/nominatim/templates/default/nominatim.cron.erb

index b10c9232737db54cc1507c0dd3bb1f6b5ce24bd8..ea5533515899805a879218eb16aa51f07675bea3 100644 (file)
@@ -379,7 +379,7 @@ end
 
 fail2ban_jail "nominatim" do
   filter "nominatim"
-  logpath "/var/log/apache2/nominatim.openstreetmap.org-access.log"
+  logpath "#{node[:nominatim][:logdir]}/nominatim.openstreetmap.org-access.log"
   ports [80, 443]
   maxretry 100
   ignoreips web_servers
index 652fd93a334251e9a3133f1d3a4f2e5062dc5b8e..39fa83289506f9b0f133b94c1b052ccb1a6a7922 100644 (file)
@@ -27,7 +27,7 @@
 
     RequestReadTimeout header=15-30,MinRate=500 body=15-30,MinRate=500
 
-    CustomLog /var/log/apache2/nominatim.openstreetmap.org-access.log combined
+    CustomLog <%= node[:nominatim][:logdir] %>/nominatim.openstreetmap.org-access.log combined
     ErrorLog /var/log/apache2/nominatim.openstreetmap.org-error.log
 
     DocumentRoot <%= @directory %>/website
index fc57f8156e2ec734ba160d935664750df72d5f08..8835397f3081a2a0e2611d3f9c1d67acf31ccb8d 100644 (file)
     /bin/systemctl reload apache2
   endscript
 }
+
+
+<%= node[:nominatim][:logdir] %>/nominatim.openstreetmap.org-access.log {
+  daily
+  missingok
+  rotate 42
+  compress
+  delaycompress
+  notifempty
+  create 640 root adm
+  sharedscripts
+  postrotate
+    /bin/systemctl reload apache2
+  endscript
+}
index 0cedfa360b718cc619e393490a62141d0ef447c8..3ad64d4d388f13f2cf86d17f59701f75eba28891 100644 (file)
@@ -2,7 +2,7 @@
 
 MAILTO=<%= @mailto %>
 
-* * * * * lonvia <%= @bin_directory %>/cron_ipanalyse.py /var/log/apache2/nominatim.openstreetmap.org-access.log
+* * * * * lonvia <%= @bin_directory %>/cron_ipanalyse.py <%= node[:nominatim][:logdir] %>/nominatim.openstreetmap.org-access.log
 <% if node[:nominatim][:enable_backup] -%>
 00 3 1 * * nominatim /usr/local/bin/backup-nominatim
 <% end -%>