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 b10c923..ea55335 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 652fd93..39fa832 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 fc57f81..8835397 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 0cedfa3..3ad64d4 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 -%>