diff options
author | Michael Scherer <misc@redhat.com> | 2021-04-21 17:03:38 +0200 |
---|---|---|
committer | Michael Scherer <misc@redhat.com> | 2021-04-21 17:03:38 +0200 |
commit | 978a6c928cd0b6d420dcf15e349776c8bfc65ebc (patch) | |
tree | 1f5770565875126d3bd17afc7c46bb0ad9c2e899 /roles/awstats_vhost | |
parent | f7c1a22758671df53783b46549784c9f562910bf (diff) |
Add awstats logs
Diffstat (limited to 'roles/awstats_vhost')
-rw-r--r-- | roles/awstats_vhost/meta/main.yml | 8 | ||||
-rw-r--r-- | roles/awstats_vhost/tasks/main.yml | 18 | ||||
-rw-r--r-- | roles/awstats_vhost/templates/awstats.conf | 17 |
3 files changed, 43 insertions, 0 deletions
diff --git a/roles/awstats_vhost/meta/main.yml b/roles/awstats_vhost/meta/main.yml new file mode 100644 index 0000000..19433aa --- /dev/null +++ b/roles/awstats_vhost/meta/main.yml @@ -0,0 +1,8 @@ +--- +dependencies: +- role: httpd + documentroot: /usr/share/awstats/wwwroot/ + redirects: + - src: '^/$' + target: '/cgi-bin/awstats.pl' + match: True diff --git a/roles/awstats_vhost/tasks/main.yml b/roles/awstats_vhost/tasks/main.yml new file mode 100644 index 0000000..90d0691 --- /dev/null +++ b/roles/awstats_vhost/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: Deploy custom config for awstats + template: + dest: "/etc/httpd/conf.d/{{ _website_domain }}.conf.d/awstats.conf" + src: awstats.conf + notify: verify config and restart httpd + +- package: + name: python-passlib + state: present + +- htpasswd: + path: /etc/httpd/htpasswd + name: "guest" + password: "{{ awstats_guest_password }}" + owner: root + group: apache + mode: 0640 diff --git a/roles/awstats_vhost/templates/awstats.conf b/roles/awstats_vhost/templates/awstats.conf new file mode 100644 index 0000000..b7c013f --- /dev/null +++ b/roles/awstats_vhost/templates/awstats.conf @@ -0,0 +1,17 @@ +ScriptAlias /cgi-bin/ "/usr/share/awstats/wwwroot/cgi-bin/" + +SetEnv AWSTATS_CONFIG www.theopensourceway.org +<Directory "/usr/share/awstats/wwwroot/cgi-bin"> + Options +ExecCGI + AddHandler cgi-script .pl + AllowOverride None + Require all granted +</Directory> + +<Location / > + AuthType Basic + AuthName "Authentication Required" + AuthUserFile "/etc/httpd/htpasswd" + require valid-user +</Location> + |