diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 73 |
1 files changed, 15 insertions, 58 deletions
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 = <<<EOC - "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 = <<<EOC "bin-environment" => ( "PHP_FCGI_CHILDREN" => "0", @@ -806,18 +796,23 @@ EOC; ), EOC; + } else if ($captive_portal == true) { + $bin_environment = <<<EOC + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "{$max_procs}", + "PHP_FCGI_MAX_REQUESTS" => "500" + ), +EOC; + } else $bin_environment = <<<EOC "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 = <<<EOD + $fastcgi_config = <<<EOD #### fastcgi module ## read fastcgi.txt for more info fastcgi.server = ( ".php" => @@ -832,20 +827,7 @@ fastcgi.server = ( ".php" => ) ) -#### CGI module -cgi.assign = ( ".cgi" => "" ) - EOD; - } else { - $fastcgi_config = ""; - $module = "\"mod_cgi\""; - $cgi_config = <<<EOD -#### CGI module -cgi.assign = ( ".php" => "/usr/local/bin/php", - ".cgi" => "" ) - -EOD; - } $lighty_config = ""; $lighty_config .= <<<EOD @@ -861,28 +843,9 @@ server.event-handler = "freebsd-kqueue" server.network-backend = "writev" ## modules to load -server.modules = ( - {$captive_portal_module} - "mod_access", "mod_accesslog", "mod_expire", "mod_compress", "mod_redirect", - {$module}{$captiveportal} - ) - -## Unused modules -# "mod_setenv", -# "mod_rewrite", -# "mod_ssi", -# "mod_usertrack", -# "mod_expire", -# "mod_secdownload", -# "mod_rrdtool", -# "mod_auth", -# "mod_status", -# "mod_alias", -# "mod_proxy", -# "mod_simple_vhost", -# "mod_evhost", -# "mod_userdir", -# "mod_cgi", +server.modules = ( "mod_access", "mod_accesslog", "mod_expire", "mod_compress", "mod_redirect", "mod_fastcgi" + {$captiveportal} + ) server.max-keep-alive-requests = 15 server.max-keep-alive-idle = 30 @@ -896,7 +859,7 @@ server.document-root = "{$document_root}" server.max-write-idle = 999 ## where to send error-messages to -server.errorlog = "/var/log/lighttpd.error.log" +server.errorlog-use-syslog="enable" # files to check for if .../ is requested server.indexfiles = ( "index.php", "index.html", @@ -958,9 +921,6 @@ mimetype.assign = ( # Use the "Content-Type" extended attribute to obtain mime type if possible #mimetypes.use-xattr = "enable" -#### accesslog module -#accesslog.filename = "/dev/null" - ## deny access the file-extensions # # ~ is for backupfiles from vi, emacs, joe, ... @@ -968,7 +928,6 @@ mimetype.assign = ( # of the document-root url.access-deny = ( "~", ".inc" ) - ######### Options that are good to be but not neccesary to be changed ####### ## bind to port (default: 80) @@ -1000,8 +959,6 @@ compress.filetype = ("text/plain","text/css", "text/xml", "text/javascript" ) {$fastcgi_config} -{$cgi_config} - {$captive_portal_mod_evasive} expire.url = ( |