From 69cc8ef7e4fb392a56b4a29c2df61ee95efc7bf0 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 12 Jun 2017 11:55:24 +0200 Subject: [PATCH] Add Apache configuration for server-status and server-info --- apache2/files/server-info.conf | 20 ++++++++ apache2/files/server-status.conf | 35 ++++++++++++++ apache2/init.sls | 82 ++++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 apache2/files/server-info.conf create mode 100644 apache2/files/server-status.conf diff --git a/apache2/files/server-info.conf b/apache2/files/server-info.conf new file mode 100644 index 0000000..b3e5f59 --- /dev/null +++ b/apache2/files/server-info.conf @@ -0,0 +1,20 @@ + + + # Allow remote server configuration reports, with the URL of + # http://servername/server-info (requires that mod_info.c be loaded). + # + + SetHandler server-info + AuthName "Server Status Access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/apache2/info_users_passwd + + Require local + Require valid-user + + + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/files/server-status.conf b/apache2/files/server-status.conf new file mode 100644 index 0000000..b61bb58 --- /dev/null +++ b/apache2/files/server-status.conf @@ -0,0 +1,35 @@ + + # Allow server status reports generated by mod_status, + # with the URL of http://servername/server-status + + + SetHandler server-status + AuthName "Server Status Access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/apache2/info_users_passwd + + Require local + Require valid-user + + + + + # Keep track of extended status information for each request + ExtendedStatus On + + # Determine if mod_status displays the first 63 characters of a request or + # the last 63, assuming the request itself is greater than 63 chars. + # Default: Off + #SeeRequestTail On + + + + # Show Proxy LoadBalancer status in mod_status + ProxyStatus On + + + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/init.sls b/apache2/init.sls index 048fa12..f4e3265 100644 --- a/apache2/init.sls +++ b/apache2/init.sls @@ -10,11 +10,15 @@ apache2: - require: - pkg: apache2 - file: apache2_custom_log_symlink + - file: apache2_mod_server_info_symlink + - file: apache2_mod_server_status_symlink - file: apache2_default_config_include - file: apache2_default_config - file: apache2_default_config_ssl - watch: - file: apache2_custom_log_conf + - file: apache2_mod_server_info_conf + - file: apache2_mod_server_status_conf - file: apache2_default_config_include - file: apache2_default_config - file: apache2_default_config_include @@ -88,6 +92,84 @@ apache2_custom_log_symlink: - file: apache2_enabled_conf_conf_dir - file: apache2_custom_log_conf +apache2_avail_mods_conf_dir: + file.directory: + - name: /etc/apache2/mods-available + - user: root + - group: root + - mode: 0755 + - require: + - file: apache2_conf_dir + +apache2_enabled_mods_conf_dir: + file.directory: + - name: /etc/apache2/mods-enabled + - user: root + - group: root + - mode: 0755 + - require: + - file: apache2_conf_dir + +apache2_info_users_passwd: + file.managed: + - name: /etc/apache2/info_users_passwd + - source: salt://apache2/files/info_users_passwd + - user: root + - group: root + - mode: 0644 + - require: + - file: apache2_conf_dir + +apache2_mod_server_info_conf: + file.managed: + - name: /etc/apache2/mods-available/info.conf + - source: salt://apache2/files/server-info.conf + - user: root + - group: root + - mode: 0644 + - template: jinja + - backup: minion + - require: + - file: apache2_avail_mods_conf_dir + - file: apache2_info_users_passwd + +apache2_mod_server_info_symlink: + file.symlink: + - name: /etc/apache2/mods-enabled/info.conf + - target: ../mods-available/info.conf + - force: True + - backupname: /etc/apache2/mods-enabled/info.conf.disabled + - user: root + - group: root + - require: + - file: apache2_enabled_mods_conf_dir + - file: apache2_mod_server_info_conf + +apache2_mod_server_status_conf: + file.managed: + - name: /etc/apache2/mods-available/status.conf + - source: salt://apache2/files/server-status.conf + - user: root + - group: root + - mode: 0644 + - template: jinja + - backup: minion + - require: + - file: apache2_avail_mods_conf_dir + - file: apache2_info_users_passwd + +apache2_mod_server_status_symlink: + file.symlink: + - name: /etc/apache2/mods-enabled/status.conf + - target: ../mods-available/status.conf + - force: True + - backupname: /etc/apache2/mods-enabled/status.conf.disabled + - user: root + - group: root + - require: + - file: apache2_enabled_mods_conf_dir + - file: apache2_mod_server_status_conf + apache2_sites_conf_dir: file.directory: - name: /etc/apache2/sites-available -- 2.39.5