aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-22 21:58:16 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-22 21:58:16 -0400
commitdb73133e535c49352ea4aecfb475393a3b298d87 (patch)
treef6a68238d81b3014e8b07b4d528a5626edd979f7
parent91a91ead3dd6da36e649611cc1a2c9fb532d7764 (diff)
downloadpfsense-packages-db73133e535c49352ea4aecfb475393a3b298d87.tar.gz
pfsense-packages-db73133e535c49352ea4aecfb475393a3b298d87.tar.bz2
pfsense-packages-db73133e535c49352ea4aecfb475393a3b298d87.zip
Match examples
-rw-r--r--config/apache_mod_security/apache_mod_security.inc33
1 files changed, 24 insertions, 9 deletions
diff --git a/config/apache_mod_security/apache_mod_security.inc b/config/apache_mod_security/apache_mod_security.inc
index bea52211..bc079f0e 100644
--- a/config/apache_mod_security/apache_mod_security.inc
+++ b/config/apache_mod_security/apache_mod_security.inc
@@ -64,17 +64,32 @@ EOF;
if($config['installedpackages']['apachemodsecurity']) {
foreach($config['installedpackages']['apachemodsecurity']['config'] as $ams) {
$backend_sites = "";
- if(count($ams['row']) == 1) {
- // 1 backend example
-
- } else {
- // multiple backend examples
- foreach($ams['row'] as $row)
- $backend_sites .= "{$row['webserveripaddr']} ";
- }
-
+ foreach($ams['row'] as $row)
+ $additionalsitehostnames .= "{$row['additionalsitehostnames']} ";
+ foreach($ams['row'] as $row)
+ $backend_sites .= "{$row['webserveripaddr']} ";
+ $serveradmin = $ams['siteemail'];
+ $primarysitehostname = $ams['primarysitehostname'];
+ $additionalsitehostnames = $ams['primarysitehostname'];
$sitename = str_replace(" ", "", $ams['sitename']);
$mod_proxy .= "\n";
+ // Is this item a load balancer
+ if(count($ams['row'])>1) {
+ $balancer = true;
+ $mod_proxy .= "<Proxy balancer://{$sitename}>\n";
+ foreach($ams['row'] as $row)
+ $mod_proxy .= " BalancerMember {$row['webserveripaddr']}\n";
+ $mod_proxy .= "</Proxy>\n";
+ $backend_sites = " balancer://{$sitename}\n";
+ $sitename = ""; // we are not using sitename in this case
+ $backend_sites = ""; // we are not using it, use the Proxy definition
+ }
+ if($additionalsitehostnames)
+ $mod_proxy .= " ServerAlias $additionalsitehostnames\n";
+ if($serveradmin)
+ $mod_proxy .= " ServerAdmin $serveradmin \n";
+ if($primarysitehostname)
+ $mod_proxy .= " ServerName $primarysitehostname \n";
if($backend_sites) {
$mod_proxy .= "ProxyPassReverse /{$sitename} {$backend_sites}\n";
$mod_proxy .= "ProxyPass / {$backend_sites}\n";