]> Frank Brehm's Git Trees - salt/states.git/commitdiff
Add Apache configuration for server-status and server-info
authorFrank Brehm <frank@brehm-online.com>
Mon, 12 Jun 2017 09:55:24 +0000 (11:55 +0200)
committerFrank Brehm <frank@brehm-online.com>
Mon, 12 Jun 2017 09:55:24 +0000 (11:55 +0200)
apache2/files/server-info.conf [new file with mode: 0644]
apache2/files/server-status.conf [new file with mode: 0644]
apache2/init.sls

diff --git a/apache2/files/server-info.conf b/apache2/files/server-info.conf
new file mode 100644 (file)
index 0000000..b3e5f59
--- /dev/null
@@ -0,0 +1,20 @@
+<IfModule mod_info.c>
+
+       # Allow remote server configuration reports, with the URL of
+       #  http://servername/server-info (requires that mod_info.c be loaded).
+       #
+       <Location /server-info>
+               SetHandler server-info
+               AuthName "Server Status Access"
+               AuthType Basic
+               AuthBasicProvider file
+               AuthUserFile /etc/apache2/info_users_passwd
+               <RequireAny>
+                       Require local
+                       Require valid-user
+               </RequireAny>
+       </Location>
+
+</IfModule>
+
+# 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 (file)
index 0000000..b61bb58
--- /dev/null
@@ -0,0 +1,35 @@
+<IfModule mod_status.c>
+       # Allow server status reports generated by mod_status,
+       # with the URL of http://servername/server-status
+
+       <Location /server-status>
+               SetHandler server-status
+               AuthName "Server Status Access"
+               AuthType Basic
+               AuthBasicProvider file
+               AuthUserFile /etc/apache2/info_users_passwd
+               <RequireAny>
+                       Require local
+                       Require valid-user
+               </RequireAny>
+
+       </Location>
+
+       # 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
+
+
+       <IfModule mod_proxy.c>
+               # Show Proxy LoadBalancer status in mod_status
+               ProxyStatus On
+       </IfModule>
+
+
+</IfModule>
+
+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
index 048fa12d9ed342f1156198d1fc2fba0557c85af1..f4e3265370d0a55f1bcdd7acfa91147a34494bd1 100644 (file)
@@ -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