summaryrefslogtreecommitdiff
path: root/templates/vhosts/redirect
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-08-11 14:06:53 +0200
committermh <mh@immerda.ch>2010-08-11 14:06:53 +0200
commit7bbb0feacac0565457f5f56f65468429803454fb (patch)
tree7c384ffbea93302afebacdaae9492b3279fd02e1 /templates/vhosts/redirect
parentd50296539fc641b6387fcea712d950785c83cea3 (diff)
introduce logmode feature
We are now able to select how apache should log accesses. These modes are: * default: as you would use it * semianonym: no ips are logged for CustomLog, ErrorLog still logs ips * anonym: no ips are logged for CustomLog, ErrorLog is sent to /dev/null * nologs: all logs are sent to /dev/null
Diffstat (limited to 'templates/vhosts/redirect')
-rw-r--r--templates/vhosts/redirect/redirect.erb32
1 files changed, 28 insertions, 4 deletions
diff --git a/templates/vhosts/redirect/redirect.erb b/templates/vhosts/redirect/redirect.erb
index 4fdd8c2..0af8bcb 100644
--- a/templates/vhosts/redirect/redirect.erb
+++ b/templates/vhosts/redirect/redirect.erb
@@ -10,8 +10,20 @@
ServerAdmin <%= server_admin %>
<%- end -%>
- ErrorLog logs/redirect_<%= servername %>_error.log
- CustomLog logs/redirect_<%= servername %>_access.log combined
+ <%- case logmode.to_s
+ when 'nologs' -%>
+ ErrorLog /dev/null
+ CustomLog /dev/null
+ <%- when 'semianonym' -%>
+ ErrorLog <%= logdir %>/error_log
+ CustomLog <%= logdir %>/access_log noip
+ <%- when 'anonym' -%>
+ ErrorLog /dev/null
+ CustomLog <%= logdir %>/access_log noip
+ <%- else -%>
+ ErrorLog <%= logdir %>/error_log
+ CustomLog <%= logdir %>/access_log combined
+ <%- end -%>
<%- if ssl_mode.to_s == 'force' then -%>
Redirect permanent / https://<%= servername %>/
<% else -%>
@@ -32,8 +44,20 @@
ServerAdmin <%= server_admin %>
<%- end -%>
- ErrorLog logs/redirect_<%= servername %>_error.log
- CustomLog logs/redirect_<%= servername %>_access.log combined
+ <%- case logmode.to_s
+ when 'nologs' -%>
+ ErrorLog /dev/null
+ CustomLog /dev/null
+ <%- when 'semianonym' -%>
+ ErrorLog <%= logdir %>/error_log
+ CustomLog <%= logdir %>/access_log noip
+ <%- when 'anonym' -%>
+ ErrorLog /dev/null
+ CustomLog <%= logdir %>/access_log noip
+ <%- else -%>
+ ErrorLog <%= logdir %>/error_log
+ CustomLog <%= logdir %>/access_log combined
+ <%- end -%>
Redirect permanent / https://<%= options %>