From d42c919b096049be5952f054862f76e4a8ee45e4 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 5 Dec 2023 09:34:53 -0700 Subject: [PATCH] func: add restorecon as in some instances httpd fails --- func/core/pkg_httpd/30-test-basic-auth.sh | 2 ++ func/core/pkg_httpd/40-test-basic-vhost.sh | 2 ++ func/core/pkg_httpd/50-test-basic-php.sh | 2 ++ 3 files changed, 6 insertions(+) diff --git a/func/core/pkg_httpd/30-test-basic-auth.sh b/func/core/pkg_httpd/30-test-basic-auth.sh index ca9ac33..5b29ef9 100755 --- a/func/core/pkg_httpd/30-test-basic-auth.sh +++ b/func/core/pkg_httpd/30-test-basic-auth.sh @@ -16,6 +16,8 @@ EOF htpasswd -c -b /etc/httpd/htpasswd tester tester mkdir -p /var/www/html/basic_auth echo "Basic Auth Test" > /var/www/html/basic_auth/index.html +# This isn't normally needed, it should just work +restorecon -R /var/www/html m_serviceCycler httpd cycle curl -s -u tester:tester http://localhost/basic_auth/ | grep -q 'Basic Auth Test' > /dev/null 2>&1 r_checkExitStatus $? diff --git a/func/core/pkg_httpd/40-test-basic-vhost.sh b/func/core/pkg_httpd/40-test-basic-vhost.sh index 52b578d..1870993 100755 --- a/func/core/pkg_httpd/40-test-basic-vhost.sh +++ b/func/core/pkg_httpd/40-test-basic-vhost.sh @@ -21,6 +21,8 @@ EOF mkdir -p /var/www/vhost/coretest echo "core vhost test page" > /var/www/vhost/coretest/index.html +# This isn't normally needed, it should just work +restorecon -R /var/www/vhost m_serviceCycler httpd cycle curl -s http://coretest/ | grep -q 'core vhost test page' > /dev/null 2>&1 diff --git a/func/core/pkg_httpd/50-test-basic-php.sh b/func/core/pkg_httpd/50-test-basic-php.sh index d0f1d72..20ceb59 100755 --- a/func/core/pkg_httpd/50-test-basic-php.sh +++ b/func/core/pkg_httpd/50-test-basic-php.sh @@ -2,6 +2,8 @@ r_log "httpd" "Test basic php" echo "" > /var/www/html/test.php +# This isn't normally needed, it should just work +restorecon -R /var/www/html curl -s http://localhost/test.php | grep -q 'PHP Version' > /dev/null 2>&1 r_checkExitStatus $?