3 # Alias: TCP host address for Apache
6 # Configure the TCP host address for the Apache webserver
7 # process of this site. This option is only useful if
8 # APACHE is set to "on" and WEBSERVER is set to "own".
10 # It might be useful to change the host address the site
11 # Apache webserver listes to.
13 # After changing this variable, the man Apache webserver
17 # Load other config options. This hook needs
19 if [ -f $OMD_ROOT/etc
/omd
/site.conf
]; then
20 .
$OMD_ROOT/etc
/omd
/site.conf
22 CONFIG_APACHE_TCP_PORT
=${CONFIG_APACHE_TCP_PORT:-0}
30 echo "([a-z0-9-]+|(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3}))"
34 cat <<EOF > $OMD_ROOT/etc/apache/listen-port.conf
35 # This file is managed by 'omd config set APACHE_TCP_PORT' and 'omd config set APACHE_TCP_ADDR'.
36 # Better do not edit manually
37 Listen $APACHE_HOST:$CONFIG_APACHE_TCP_PORT
39 cat <<EOF > $OMD_ROOT/etc/apache/proxy-port.conf
40 # This file is managed by 'omd config set APACHE_TCP_PORT' and 'omd config set APACHE_TCP_ADDR'.
41 # Better do not edit manually
42 <IfModule mod_proxy_http.c>
43 <Proxy http://$APACHE_HOST:$CONFIG_APACHE_TCP_PORT/$OMD_SITE>
49 # Setting "retry=0" to prevent 60 second caching of problem states e.g. when
50 # the site apache is down and someone tries to access the page.
51 # "disablereuse=On" prevents the apache from keeping the connection which leads to
52 # wrong devlivered pages sometimes
53 ProxyPass http://$APACHE_HOST:$CONFIG_APACHE_TCP_PORT/$OMD_SITE retry=0 disablereuse=On
54 ProxyPassReverse http://$APACHE_HOST:$CONFIG_APACHE_TCP_PORT/$OMD_SITE
60 [ "$CONFIG_APACHE_MODE" = own
]