From fedc82cee30eb6d15d90b071ecd568ef8c0d276d Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Sat, 26 Jun 2021 12:45:58 +0200 Subject: [PATCH] fix: adjusted all configuration as described in README --- .../httpd/conf.d/virtualhost-example.conf} | 3 +++ apache/etc/httpd/conf/httpd-maintenance.conf | 7 +++++++ apache/etc/httpd/conf/httpd-no-signature.conf | 4 ++++ apache/etc/httpd/conf/httpd-server-status.conf | 8 ++++++++ .../www/maintenance/index.html} | 2 +- .../www/maintenance/index.png} | Bin postgresql/{ => etc/postgresql}/pg_hba.conf | 0 .../postgresql/postgresql.conf} | 4 ++-- .../default/prometheus-apache-exporter.conf} | 0 .../default/prometheus-nginx-exporter.conf} | 0 .../default/prometheus-postgresql-exporter.conf} | 0 .../systemd/prometheus-apache-exporter.service} | 0 .../systemd/prometheus-mysqld-exporter.service} | 0 13 files changed, 25 insertions(+), 3 deletions(-) rename apache/{maintenance.conf => etc/httpd/conf.d/virtualhost-example.conf} (97%) create mode 100644 apache/etc/httpd/conf/httpd-maintenance.conf create mode 100644 apache/etc/httpd/conf/httpd-no-signature.conf create mode 100644 apache/etc/httpd/conf/httpd-server-status.conf rename apache/{maintenance.html => var/www/maintenance/index.html} (92%) rename apache/{maintenance.png => var/www/maintenance/index.png} (100%) rename postgresql/{ => etc/postgresql}/pg_hba.conf (100%) rename postgresql/{postgresql_custom.conf => etc/postgresql/postgresql.conf} (55%) rename prometheus/exporters/{apache.conf => etc/default/prometheus-apache-exporter.conf} (100%) rename prometheus/exporters/{nginx.conf => etc/default/prometheus-nginx-exporter.conf} (100%) rename prometheus/exporters/{postgresql.conf => etc/default/prometheus-postgresql-exporter.conf} (100%) rename prometheus/exporters/{apache.service => etc/systemd/systemd/prometheus-apache-exporter.service} (100%) rename prometheus/exporters/{mysqld.service => etc/systemd/systemd/prometheus-mysqld-exporter.service} (100%) diff --git a/apache/maintenance.conf b/apache/etc/httpd/conf.d/virtualhost-example.conf similarity index 97% rename from apache/maintenance.conf rename to apache/etc/httpd/conf.d/virtualhost-example.conf index 6576a7f..e08d0f4 100644 --- a/apache/maintenance.conf +++ b/apache/etc/httpd/conf.d/virtualhost-example.conf @@ -1,4 +1,6 @@ + # YOUR CONFIG + # Redirect all request to a 503 return code when in maintenance mode ErrorDocument 503 /maintenance/index.html RewriteEngine on @@ -12,4 +14,5 @@ RewriteCond /var/www/maintenance/ALL !-f RewriteCond /var/www/maintenance/%{SERVER_NAME} !-f RewriteRule ^/maintenance/index.html$ / [R,L] + diff --git a/apache/etc/httpd/conf/httpd-maintenance.conf b/apache/etc/httpd/conf/httpd-maintenance.conf new file mode 100644 index 0000000..d3fbced --- /dev/null +++ b/apache/etc/httpd/conf/httpd-maintenance.conf @@ -0,0 +1,7 @@ +## YOUR CONFIG HERE + + + ## OTHER CONFIG HERE + + Alias "/maintenance" "/var/www/maintenance" + diff --git a/apache/etc/httpd/conf/httpd-no-signature.conf b/apache/etc/httpd/conf/httpd-no-signature.conf new file mode 100644 index 0000000..09cafd0 --- /dev/null +++ b/apache/etc/httpd/conf/httpd-no-signature.conf @@ -0,0 +1,4 @@ +## MAIN CONFIG HERE + +ServerTokens Prod +ServerSignature Off diff --git a/apache/etc/httpd/conf/httpd-server-status.conf b/apache/etc/httpd/conf/httpd-server-status.conf new file mode 100644 index 0000000..8a8a49d --- /dev/null +++ b/apache/etc/httpd/conf/httpd-server-status.conf @@ -0,0 +1,8 @@ +## MAIN CONFIG HERE + + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + diff --git a/apache/maintenance.html b/apache/var/www/maintenance/index.html similarity index 92% rename from apache/maintenance.html rename to apache/var/www/maintenance/index.html index d0058ee..16fe47f 100644 --- a/apache/maintenance.html +++ b/apache/var/www/maintenance/index.html @@ -10,7 +10,7 @@
- +

We’ll be back soon!

We’re performing some hacks at the moment. diff --git a/apache/maintenance.png b/apache/var/www/maintenance/index.png similarity index 100% rename from apache/maintenance.png rename to apache/var/www/maintenance/index.png diff --git a/postgresql/pg_hba.conf b/postgresql/etc/postgresql/pg_hba.conf similarity index 100% rename from postgresql/pg_hba.conf rename to postgresql/etc/postgresql/pg_hba.conf diff --git a/postgresql/postgresql_custom.conf b/postgresql/etc/postgresql/postgresql.conf similarity index 55% rename from postgresql/postgresql_custom.conf rename to postgresql/etc/postgresql/postgresql.conf index 65c2e9f..e9efbc1 100644 --- a/postgresql/postgresql_custom.conf +++ b/postgresql/etc/postgresql/postgresql.conf @@ -1,5 +1,5 @@ -... +## OTHER CONFIG password_encryption = scram-sha-256 -... +## END CONFIG diff --git a/prometheus/exporters/apache.conf b/prometheus/exporters/etc/default/prometheus-apache-exporter.conf similarity index 100% rename from prometheus/exporters/apache.conf rename to prometheus/exporters/etc/default/prometheus-apache-exporter.conf diff --git a/prometheus/exporters/nginx.conf b/prometheus/exporters/etc/default/prometheus-nginx-exporter.conf similarity index 100% rename from prometheus/exporters/nginx.conf rename to prometheus/exporters/etc/default/prometheus-nginx-exporter.conf diff --git a/prometheus/exporters/postgresql.conf b/prometheus/exporters/etc/default/prometheus-postgresql-exporter.conf similarity index 100% rename from prometheus/exporters/postgresql.conf rename to prometheus/exporters/etc/default/prometheus-postgresql-exporter.conf diff --git a/prometheus/exporters/apache.service b/prometheus/exporters/etc/systemd/systemd/prometheus-apache-exporter.service similarity index 100% rename from prometheus/exporters/apache.service rename to prometheus/exporters/etc/systemd/systemd/prometheus-apache-exporter.service diff --git a/prometheus/exporters/mysqld.service b/prometheus/exporters/etc/systemd/systemd/prometheus-mysqld-exporter.service similarity index 100% rename from prometheus/exporters/mysqld.service rename to prometheus/exporters/etc/systemd/systemd/prometheus-mysqld-exporter.service