diff options
author | Stéphane Lapie <darksoul@darkbsd.org> | 2014-06-25 02:00:37 +0900 |
---|---|---|
committer | Stephane Lapie <stephane.lapie@asahinet.com> | 2014-06-25 10:10:57 +0900 |
commit | c93a3c793d53e9076b49e05c32a7c132329ff353 (patch) | |
tree | 42f4685ccbbd4e962e767415d138f6a15eb28eca /config/apache_mod_security-dev/apache_mod_security.inc | |
parent | ec079fc18a1289be2676fa57c15829b20cb4a912 (diff) | |
download | pfsense-packages-c93a3c793d53e9076b49e05c32a7c132329ff353.tar.gz pfsense-packages-c93a3c793d53e9076b49e05c32a7c132329ff353.tar.bz2 pfsense-packages-c93a3c793d53e9076b49e05c32a7c132329ff353.zip |
Switched back to one Apache 2.4 config template
Diffstat (limited to 'config/apache_mod_security-dev/apache_mod_security.inc')
-rw-r--r-- | config/apache_mod_security-dev/apache_mod_security.inc | 67 |
1 files changed, 19 insertions, 48 deletions
diff --git a/config/apache_mod_security-dev/apache_mod_security.inc b/config/apache_mod_security-dev/apache_mod_security.inc index 93757e22..b24a5d1c 100644 --- a/config/apache_mod_security-dev/apache_mod_security.inc +++ b/config/apache_mod_security-dev/apache_mod_security.inc @@ -39,10 +39,7 @@ if ($pf_version > 2.0) else define('APACHEDIR', '/usr/local'); -if (file_exists(APACHEDIR . "/libexec/apache22")) - define('APACHEVERSION', 'apache22'); -if (file_exists(APACHEDIR . "/libexec/apache24")) - define('APACHEVERSION', 'apache24'); +define('APACHEVERSION', 'apache24'); // End of system check define ('MODSECURITY_DIR','crs'); @@ -453,30 +450,6 @@ function generate_apache_configuration() { #load conf template include("/usr/local/pkg/apache_balancer.template"); - if (APACHEVERSION == 'apache22') { # Only define this here for apache22 - #check balancer members - foreach ($config['installedpackages']['apachebalancer']['config'] as $balancer){ - if (is_array($balancer['row']) && $balancer['enable'] == 'on'){ - $balancer_config.="# {$balancer['description']}\n"; - $balancer_config.="<Proxy balancer://{$balancer['name']}>\n"; - foreach($balancer['row'] as $server){ - $options =($server['port'] ? ":{$server['port']}" : ""); - $options.=($server['routeid'] ? " route={$server['routeid']}" : ""); - $options.=($server['loadfactor'] ? " loadfactor={$server['loadfactor']}" : ""); - if (isset($server['ping']) && $server['ping']!=""){ - $options.= " ping={$server['ping']}"; - $options.=($server['ttl'] ? " ttl={$server['ttl']}" : ""); - } - $balancer_config.=" BalancerMember {$balancer['proto']}://{$server['host']}{$options}\n"; - } - #check if stick connections are set - if ($balancer['row'][0]['routeid'] !="") - $balancer_config.=" ProxySet stickysession=ROUTEID\n"; - $balancer_config.="</Proxy>\n\n"; - } - } - } - //write balancer conf file_put_contents(APACHEDIR."/etc/" . APACHEVERSION . "/Includes/balancers.conf",$balancer_config,LOCK_EX); } @@ -602,28 +575,26 @@ EOF; $backend=$apache_location[$be['location']]; $vh_config.="# {$backend['name']}\n"; - if (APACHEVERSION == 'apache24') { # Only define this here for apache24 - foreach ($config['installedpackages']['apachebalancer']['config'] as $balancer){ - if (is_array($balancer['row']) && $balancer['enable'] == 'on' && $balancer['name'] == $backend['balancer']){ - $vh_config.="# {$balancer['description']}\n"; - $vh_config.=" <Proxy balancer://{$balancer['name']}>\n"; - foreach($balancer['row'] as $balancer_server){ - $balancer_options =($balancer_server['port'] ? ":{$balancer_server['port']}" : ""); - - $balancer_options.=($balancer_server['routeid'] ? " route={$balancer_server['routeid']}" : ""); - $balancer_options.=($balancer_server['loadfactor'] ? " loadfactor={$balancer_server['loadfactor']}" : ""); - if (isset($balancer_server['ping']) && $balancer_server['ping']!=""){ - $balancer_options.= " ping={$balancer_server['ping']}"; - $balancer_options.=($server['ttl'] ? " ttl={$balancer_server['ttl']}" : ""); - } - $vh_config.=" BalancerMember {$balancer['proto']}://{$balancer_server['host']}{$balancer_options}\n"; + foreach ($config['installedpackages']['apachebalancer']['config'] as $balancer){ + if (is_array($balancer['row']) && $balancer['enable'] == 'on' && $balancer['name'] == $backend['balancer']){ + $vh_config.="# {$balancer['description']}\n"; + $vh_config.=" <Proxy balancer://{$balancer['name']}>\n"; + foreach($balancer['row'] as $balancer_server){ + $balancer_options =($balancer_server['port'] ? ":{$balancer_server['port']}" : ""); + + $balancer_options.=($balancer_server['routeid'] ? " route={$balancer_server['routeid']}" : ""); + $balancer_options.=($balancer_server['loadfactor'] ? " loadfactor={$balancer_server['loadfactor']}" : ""); + if (isset($balancer_server['ping']) && $balancer_server['ping']!=""){ + $balancer_options.= " ping={$balancer_server['ping']}"; + $balancer_options.=($server['ttl'] ? " ttl={$balancer_server['ttl']}" : ""); } - #check if stick connections are set - if ($balancer['row'][0]['routeid'] !="") - $vh_config.=" ProxySet stickysession=ROUTEID\n"; - $vh_config.=" </Proxy>\n\n"; - break; + $vh_config.=" BalancerMember {$balancer['proto']}://{$balancer_server['host']}{$balancer_options}\n"; } + #check if stick connections are set + if ($balancer['row'][0]['routeid'] !="") + $vh_config.=" ProxySet stickysession=ROUTEID\n"; + $vh_config.=" </Proxy>\n\n"; + break; } } |