From 5c9eae7f3e9f95741d045c8ff1d91ff1f71f37cf Mon Sep 17 00:00:00 2001 From: christoph Date: Wed, 24 Apr 2024 16:32:59 +0200 Subject: [PATCH] create_vhost.sh: Add Prosy parameters to vhost configuration. --- create_vhost.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/create_vhost.sh b/create_vhost.sh index 970309d..577425f 100755 --- a/create_vhost.sh +++ b/create_vhost.sh @@ -294,6 +294,34 @@ WEBSITES_ROOT_DIR="" CREATE_SYMLINK_WEB_BASE_DIR=false +# --- +# - Determin timeout value +# --- + +if [[ -f "/usr/local/apache2/conf/httpd.conf" ]]; then + _HTTPD_CONF_FILE="/usr/local/apache2/conf/httpd.conf" +elif [[ -f "/etc/apache2/apache2.conf" ]]; then + _HTTPD_CONF_FILE="/etc/apache2/apache2.conf" +else + _HTTPD_CONF_FILE='' +fi + +if [[ -f "${_HTTPD_CONF_FILE}" ]] && $(grep -q -i -E "^\s*Timeout\s+" "${_HTTPD_CONF_FILE}") ; then + _TIMEOUT="$(grep -i -E "^\s*timeout\s+" "${_HTTPD_CONF_FILE}"| awk '{print$2}' | head -1)" +else + _TIMEOUT=60 +fi +if [[ -f "${_HTTPD_CONF_FILE}" ]] && $(grep -q -i -E "^\s*ProxyTimeout\s+" "${_HTTPD_CONF_FILE}") ; then + PROXY_TIMEOUT="$(grep -i -E "^\s*ProxyTimeout\s+" "${_HTTPD_CONF_FILE}"| awk '{print$2}' | head -1)" +else + PROXY_TIMEOUT=${_TIMEOUT} +fi + +# --- +# - END: Determin timeout value +# --- + + # --- # - Read Configuration File (if exists) # - @@ -3069,7 +3097,8 @@ elif [ "$_type" = "PHP-FPM" ]; then # Socket timeout in seconds. The number of seconds Apache httpd waits for data # sent by / to the backend. # - ProxySet timeout=30 + #ProxySet timeout=${PROXY_TIMEOUT} +