Project

General

Profile

« Previous | Next » 

Revision a96f2d3d

Added by Ermal LUÇI over 12 years ago

Remove to parameters from system_generate_lighty_config that are unused and do a better job at tuning started php processes to not use less/more than needed. This also avoids DoS the system with php processes

View differences:

etc/inc/captiveportal.inc
411 411
	if (!isset($cpcfg['enable']))
412 412
		return;
413 413

  
414
	$use_fastcgi = true;
415

  
416 414
	if (isset($cpcfg['httpslogin'])) {
417 415
		$cert = lookup_cert($cpcfg['certref']);
418 416
		$crt = base64_decode($cert['crt']);
......
423 421
		$listenporthttps = $cpcfg['listenporthttps'] ? $cpcfg['listenporthttps'] : ($cpcfg['zoneid'] + 1);
424 422
		system_generate_lighty_config("{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf",
425 423
			$crt, $key, $ca, "lighty-{$cpzone}-CaptivePortal-SSL.pid", $listenporthttps, "/usr/local/captiveportal",
426
			"cert-{$cpzone}-portal.pem", "ca-{$cpzone}-portal.pem", "1", $use_fastcgi, $cpzone);
424
			"cert-{$cpzone}-portal.pem", "ca-{$cpzone}-portal.pem", $cpzone);
427 425
	}
428 426

  
429 427
	/* generate lighttpd configuration */
430 428
	$listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : $cpcfg['zoneid'];
431 429
	system_generate_lighty_config("{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf",
432 430
		"", "", "", "lighty-{$cpzone}-CaptivePortal.pid", $listenporthttp, "/usr/local/captiveportal",
433
		"", "", "1", $use_fastcgi, $cpzone);
431
		"", "", $cpzone);
434 432

  
435 433
	/* attempt to start lighttpd */
436 434
	$res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf");

Also available in: Unified diff