Project

General

Profile

« Previous | Next » 

Revision c21b10d4

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
398 398
	 if (!isset($config['captiveportal']['enable']))
399 399
				return;
400 400

  
401
	if ($config['captiveportal']['maxprocperip'])
402
		$maxproc = $config['captiveportal']['maxprocperip'];
403
	else
404
		$maxproc = 16;
405

  
406
	$use_fastcgi = true;
407

  
408 401
	if (isset($config['captiveportal']['httpslogin'])) {
409 402
		$cert = base64_decode($config['captiveportal']['certificate']);
410 403
		if (isset($config['captiveportal']['cacertificate']))
......
415 408
		/* generate lighttpd configuration */
416 409
		system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal-SSL.conf",
417 410
			$cert, $key, $cacert, "lighty-CaptivePortal-SSL.pid", "8001", "/usr/local/captiveportal/",
418
			"cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
411
			"cert-portal.pem", "ca-portal.pem", 1, true);
419 412
	}
420 413

  
421 414
	/* generate lighttpd configuration */
422 415
	system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf",
423 416
		"", "", "", "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/",
424
		"cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
417
		"cert-portal.pem", "ca-portal.pem", 1, true);
425 418

  
426 419
	/* attempt to start lighttpd */
427 420
	$res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf");

Also available in: Unified diff