From 6f0d237e757ab25a8d333af4caf42a7d77239e5b Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 2 Jan 2013 17:03:42 +0000 Subject: Simpligy lighty config and send all lighty logs to syslog rather to a file not readble by anything --- etc/inc/system.inc | 73 +++++++++++------------------------------------------- 1 file changed, 15 insertions(+), 58 deletions(-) (limited to 'etc') diff --git a/etc/inc/system.inc b/etc/inc/system.inc index f47596a..daca4df 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -739,7 +739,6 @@ function system_generate_lighty_config($filename, if($captive_portal == true) { $captiveportal = ",\"mod_rewrite\""; $captive_portal_rewrite = "url.rewrite-once = ( \"(.*captiveportal.*)\" => \"$1\", \"(.*)\" => \"/index.php?redirurl=$1\" )\n"; - $captive_portal_module = ""; $maxprocperip = $config['captiveportal']['maxprocperip']; if($maxprocperip and $maxprocperip > 0) $captive_portal_mod_evasive = "evasive.max-conns-per-ip = {$maxprocperip}"; @@ -752,7 +751,6 @@ function system_generate_lighty_config($filename, } else { $captiveportal = ""; $captive_portal_rewrite = ""; - $captive_portal_module = ""; $captive_portal_mod_evasive = ""; $server_upload_dirs = "server.upload-dirs = ( \"{$g['upload_path']}/\", \"{$g['tmp_path']}/\", \"/var/\" )\n"; $server_max_request_size = "server.max-request-size = 2097152"; @@ -790,15 +788,7 @@ function system_generate_lighty_config($filename, } } - if($captive_portal == true) { - $bin_environment = << ( - "PHP_FCGI_CHILDREN" => "0", - "PHP_FCGI_MAX_REQUESTS" => "500" - ), -EOC; - - } else if ($avail > 0 and $avail < 128) { + if ($avail > 0 and $avail < 128) { $bin_environment = << ( "PHP_FCGI_CHILDREN" => "0", @@ -806,18 +796,23 @@ EOC; ), EOC; + } else if ($captive_portal == true) { + $bin_environment = << ( + "PHP_FCGI_CHILDREN" => "{$max_procs}", + "PHP_FCGI_MAX_REQUESTS" => "500" + ), +EOC; + } else $bin_environment = << ( - "PHP_FCGI_CHILDREN" => "0", + "PHP_FCGI_CHILDREN" => "{$max_procs}", "PHP_FCGI_MAX_REQUESTS" => "500" ), EOC; - if($fast_cgi_enable == true) { - $module = "\"mod_fastcgi\", \"mod_cgi\""; - $cgi_config = ""; - $fastcgi_config = << @@ -832,20 +827,7 @@ fastcgi.server = ( ".php" => ) ) -#### CGI module -cgi.assign = ( ".cgi" => "" ) - EOD; - } else { - $fastcgi_config = ""; - $module = "\"mod_cgi\""; - $cgi_config = << "/usr/local/bin/php", - ".cgi" => "" ) - -EOD; - } $lighty_config = ""; $lighty_config .= <<