diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-06-24 15:22:08 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-06-24 15:22:08 -0400 |
commit | 17a73e3ff4b7c27a69aa52415feb3699d8e5c584 (patch) | |
tree | 3f12eb63af10bc2a0498272f3bfa1c43b358da41 | |
parent | 74a9fe399045af40708cd9ddb9f9f272f4d7cecf (diff) | |
download | pfsense-packages-17a73e3ff4b7c27a69aa52415feb3699d8e5c584.tar.gz pfsense-packages-17a73e3ff4b7c27a69aa52415feb3699d8e5c584.tar.bz2 pfsense-packages-17a73e3ff4b7c27a69aa52415feb3699d8e5c584.zip |
Setup NameVirtualServer items and do not duplicate them
-rw-r--r-- | config/apache_mod_security/apache_mod_security.inc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/config/apache_mod_security/apache_mod_security.inc b/config/apache_mod_security/apache_mod_security.inc index a1e51aaa..698d6a69 100644 --- a/config/apache_mod_security/apache_mod_security.inc +++ b/config/apache_mod_security/apache_mod_security.inc @@ -188,6 +188,22 @@ EOF; ##################################################### */ + // Configure NameVirtualHost directives + $processed = array(); + if($config['installedpackages']['apachemodsecurity']) { + foreach($config['installedpackages']['apachemodsecurity']['config'] as $ams) { + if($ams['ipaddress'] && $ams['port']) + $local_ip_port = "{$ams['ipaddress']}:{$ams['port']}"; + else + $local_ip_port = $global_listen; + // Do not add entries twice. + if(!in_array($local_ip_port, $processed)) { + $mod_proxy .= "NameVirtualHost $local_ip_port\n"; + $processed[] = $local_ip_port; + } + } + } + // Setup mod_proxy entries $mod_proxy if($config['installedpackages']['apachemodsecurity']) { foreach($config['installedpackages']['apachemodsecurity']['config'] as $ams) { @@ -218,7 +234,7 @@ EOF; else $local_ip_port = $global_listen; // Begin VirtualHost - $mod_proxy .= "<VirtualHost {$local_ip_port}>\n"; + $mod_proxy .= "\n<VirtualHost {$local_ip_port}>\n"; // Is this item a load balancer if(count($ams['row'])>1) { $balancer = true; @@ -241,7 +257,7 @@ EOF; } if($ams['preserveproxyhostname']) $mod_proxy .= " ProxyPreserveHost on\n"; - $mod_proxy .= "</VirtualHost>\n"; + $mod_proxy .= "</VirtualHost>\n\n"; // End VirtualHost } } |