diff --git a/apache.cf b/apache.cf index e174057..1c7c7f5 100644 --- a/apache.cf +++ b/apache.cf @@ -339,6 +339,7 @@ classes: "delete" expression => $(site[disable]); "use_ssl" expression => $(site[ssl]); "use_certbot" expression => strcmp("certbot","$(site[ssl_cert])"); + "do_logrotate" expression => $(site[logrotate]); vars: # "email":$(apache.admin_email), @@ -350,7 +351,10 @@ vars: "doc_root":"$(apache.www_dir)/$(site_param[domain])", "doc_root_options":"Indexes FollowSymLinks", "php":true, - "php_handler":"$(apache.default_php_handler)" + "php_handler":"$(apache.default_php_handler)", + "logging80":true, + "logging443":true, + "logrotate":false, } '; @@ -420,6 +424,16 @@ methods: "any" usebundle => restart_apache("$(site[domain])"), depends_on => {"vhost_cfg_done$(site[domain])" }; + "any" usebundle => install_logrot; + +files: + do_logrotate:: + "$(logrot.dir)/$(site[domain])" + create => "true", + edit_defaults => backup("false"), + edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/httpd-weblogrot.mustache", + template_method => "mustache"; + commands: @@ -432,6 +446,11 @@ commands: reports: +# "SITE: $(site[domain]): $(site[logrotate])"; +# !do_logrotate:: +# "LOGOROOTATE FOR $(site[domain]): FALSE"; +# do_logrotate:: +# "LOGOROOTATE FOR $(site[domain]): TRUE"; } @@ -483,7 +502,7 @@ any:: }'; "template_file" - string => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/weblogrot.mustache"; + string => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/httpd-weblogrot-matomo.mustache"; methods: "any" usebundle => install_logrot;