From 8b59acc20071fd66cd99f4b1f667da2ee88440a9 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 21 Jun 2009 20:47:29 -0400 Subject: Reduce configuration to common --- config/apache_mod_security/apache_mod_security.inc | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'config/apache_mod_security') diff --git a/config/apache_mod_security/apache_mod_security.inc b/config/apache_mod_security/apache_mod_security.inc index 7701d335..0ecd1d6b 100644 --- a/config/apache_mod_security/apache_mod_security.inc +++ b/config/apache_mod_security/apache_mod_security.inc @@ -26,26 +26,25 @@ function generate_apache_configuration() { // Generate mod_proxy specific configuration $mod_proxy = "ProxyRequests on\n"; + $mod_proxy = << + Order deny,allow + Allow from all + + +EOF; + if($config['installedpackages']['apachemodsecurity']) { foreach($config['installedpackages']['apachemodsecurity']['config'] as $ams) { - $sitename = str_replace(" ", "", $ams['sitename']); - $mod_proxy .= "ProxyPass /{$sitename}/ "; + $backend_sites = ""; foreach($ams['row'] as $row) - $mod_proxy .= " {$row['webserveripaddr']}"; - $mod_proxy .= "\n"; - - $mod_proxy .= "\n"; - $mod_proxy .= " ProxyRemote {$ams['siteurl']}"; - foreach($ams['row'] as $row) - $mod_proxy .= " {$row['webserveripaddr']}"; + $backend_sites .= "{$row['webserveripaddr']} "; + $sitename = str_replace(" ", "", $ams['sitename']); $mod_proxy .= "\n"; - $mod_proxy .= " ProxyPassReverse /\n"; - $mod_proxy .= " SetOutputFilter proxy-html\n"; -// $mod_proxy .= "ProxyHTMLURLMap {$ams['siteurl']} /{$sitename} \n"; -// $mod_proxy .= " ProxyHTMLURLMap / /{$sitename}/\n"; -// $mod_proxy .= " ProxyHTMLURLMap /{$ams['sitename']} /{$sitename}\n"; - $mod_proxy .= " RequestHeader unset Accept-Encoding\n"; - $mod_proxy .= "\n"; + if($backend_sites) { + $mod_proxy .= "ProxyPass /{$sitename} {$backend_sites}\n"; + $mod_proxy .= "ProxyPassReverse / {$backend_sites}\n"; + } } } // Set global site e-mail -- cgit v1.2.3