From f756daba595238228d5b32552c6a85537ec2678a Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Thu, 25 Jul 2024 23:00:41 -0400 Subject: [PATCH 1/6] Inline Apache configuration into the application install scripts. --- .../applications/apache/centos_rhel/install | 14 +++++++++++++- .../applications/apache/debian_ubuntu/install | 14 +++++++++++++- .../applications/apache/sles/install | 14 +++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install index 7122e0011f..a95f363467 100644 --- a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install @@ -1,6 +1,18 @@ set -e sudo yum -y install httpd -(cd /etc/httpd/conf.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf) +sudo mkdir -p /etc/httpd/conf.d/ +sudo tee /etc/httpd/conf.d/status.conf >/dev/null < + ServerName local-stackdriver-agent.stackdriver.com + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + +EOF sudo service httpd start diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index b7b66a2d22..9e23bd309f 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -2,6 +2,18 @@ set -e sudo apt update sudo apt install -y apache2 -(cd /etc/apache2/conf-available/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf) +sudo mkdir -p /etc/httpd/conf.d/ +sudo tee /etc/httpd/conf.d/status.conf >/dev/null < + ServerName local-stackdriver-agent.stackdriver.com + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + +EOF sudo service apache2 start diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index 4318975f8d..cb0a7e45b5 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -14,7 +14,19 @@ sudo zypper -n refresh sudo zypper -n install apache2 -(cd /etc/apache2/conf.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf) +sudo mkdir -p /etc/httpd/conf.d/ +sudo tee /etc/httpd/conf.d/status.conf >/dev/null < + ServerName local-stackdriver-agent.stackdriver.com + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + +EOF sudo a2enmod mod_status sudo a2enmod mod_access_compat From 466f67f647b150fe473f427ae36987658c338d28 Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Fri, 26 Jul 2024 01:55:06 -0400 Subject: [PATCH 2/6] Remove ServerName. --- .../applications/apache/centos_rhel/install | 1 - .../applications/apache/debian_ubuntu/install | 1 - .../third_party_apps_test/applications/apache/sles/install | 1 - 3 files changed, 3 deletions(-) diff --git a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install index a95f363467..30216d5b41 100644 --- a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install @@ -5,7 +5,6 @@ sudo mkdir -p /etc/httpd/conf.d/ sudo tee /etc/httpd/conf.d/status.conf >/dev/null < - ServerName local-stackdriver-agent.stackdriver.com SetHandler server-status Order deny,allow diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index 9e23bd309f..8afad6c664 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -6,7 +6,6 @@ sudo mkdir -p /etc/httpd/conf.d/ sudo tee /etc/httpd/conf.d/status.conf >/dev/null < - ServerName local-stackdriver-agent.stackdriver.com SetHandler server-status Order deny,allow diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index cb0a7e45b5..dfa7a406ef 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -18,7 +18,6 @@ sudo mkdir -p /etc/httpd/conf.d/ sudo tee /etc/httpd/conf.d/status.conf >/dev/null < - ServerName local-stackdriver-agent.stackdriver.com SetHandler server-status Order deny,allow From 2d268f71c188888da3234ad35956465023cbca22 Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Fri, 26 Jul 2024 00:14:31 -0400 Subject: [PATCH 3/6] Testing: curl server-status --- .../applications/apache/centos_rhel/install | 1 + .../applications/apache/debian_ubuntu/install | 1 + .../third_party_apps_test/applications/apache/sles/install | 1 + 3 files changed, 3 insertions(+) diff --git a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install index 30216d5b41..4d4731b755 100644 --- a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install @@ -15,3 +15,4 @@ ExtendedStatus on EOF sudo service httpd start +curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index 8afad6c664..5de4261e02 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -16,3 +16,4 @@ ExtendedStatus on EOF sudo service apache2 start +curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index dfa7a406ef..8d037e8064 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -30,3 +30,4 @@ sudo a2enmod mod_status sudo a2enmod mod_access_compat sudo service apache2 start +curl http://localhost:80/server-status?auto From e0d66a97546a5aabdadc8c1fd0bfa0cd5a0f3e81 Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Mon, 29 Jul 2024 14:07:06 -0400 Subject: [PATCH 4/6] Revert "Testing: curl server-status" This reverts commit 2d268f71c188888da3234ad35956465023cbca22. --- .../applications/apache/centos_rhel/install | 1 - .../applications/apache/debian_ubuntu/install | 1 - .../third_party_apps_test/applications/apache/sles/install | 1 - 3 files changed, 3 deletions(-) diff --git a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install index 4d4731b755..30216d5b41 100644 --- a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install @@ -15,4 +15,3 @@ ExtendedStatus on EOF sudo service httpd start -curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index 5de4261e02..8afad6c664 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -16,4 +16,3 @@ ExtendedStatus on EOF sudo service apache2 start -curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index 8d037e8064..dfa7a406ef 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -30,4 +30,3 @@ sudo a2enmod mod_status sudo a2enmod mod_access_compat sudo service apache2 start -curl http://localhost:80/server-status?auto From 9f8af87430aef9c5cc6b0c2f25296b8b4759ba3b Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Mon, 5 Aug 2024 11:57:06 -0400 Subject: [PATCH 5/6] Use appropriate configuration directories. --- .../applications/apache/debian_ubuntu/install | 4 ++-- .../third_party_apps_test/applications/apache/sles/install | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index 8afad6c664..731bff5070 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -2,8 +2,8 @@ set -e sudo apt update sudo apt install -y apache2 -sudo mkdir -p /etc/httpd/conf.d/ -sudo tee /etc/httpd/conf.d/status.conf >/dev/null </dev/null < diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index dfa7a406ef..e73101362a 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -14,8 +14,8 @@ sudo zypper -n refresh sudo zypper -n install apache2 -sudo mkdir -p /etc/httpd/conf.d/ -sudo tee /etc/httpd/conf.d/status.conf >/dev/null </dev/null < From 9fb0f5523b2cd9be90e64eba7347175c64edd714 Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Mon, 5 Aug 2024 12:29:58 -0400 Subject: [PATCH 6/6] Reapply "Testing: curl server-status" This gives a clear indication in tests that mod_status has been set up properly, making it easier to debug any issues. --- .../applications/apache/centos_rhel/install | 2 ++ .../applications/apache/debian_ubuntu/install | 2 ++ .../third_party_apps_test/applications/apache/sles/install | 2 ++ 3 files changed, 6 insertions(+) diff --git a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install index 30216d5b41..aec654504b 100644 --- a/integration_test/third_party_apps_test/applications/apache/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/apache/centos_rhel/install @@ -15,3 +15,5 @@ ExtendedStatus on EOF sudo service httpd start +sleep 2 +curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install index 731bff5070..509120f8d3 100644 --- a/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install +++ b/integration_test/third_party_apps_test/applications/apache/debian_ubuntu/install @@ -16,3 +16,5 @@ ExtendedStatus on EOF sudo service apache2 start +sleep 2 +curl http://localhost:80/server-status?auto diff --git a/integration_test/third_party_apps_test/applications/apache/sles/install b/integration_test/third_party_apps_test/applications/apache/sles/install index e73101362a..0986d099f5 100644 --- a/integration_test/third_party_apps_test/applications/apache/sles/install +++ b/integration_test/third_party_apps_test/applications/apache/sles/install @@ -30,3 +30,5 @@ sudo a2enmod mod_status sudo a2enmod mod_access_compat sudo service apache2 start +sleep 2 +curl http://localhost:80/server-status?auto