From 3a66b6211b8d06e494fb4ac73da5d59eacd4529d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 18 Sep 2005 02:21:42 +0000 Subject: * Additional tuning parms * Support captive portal SSL --- etc/inc/captiveportal.inc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'etc/inc/captiveportal.inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index fd9211d..e668cd5 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -154,21 +154,13 @@ EOD; /* start web server */ // mwexec("/usr/local/sbin/mini_httpd -a -M 0 -u root -maxproc 16" . // " -p 8000 -i {$g['varrun_path']}/mini_httpd.cp.pid"); - - /* generate lighttpd configuration */ - system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf", - $key, $cert, "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/"); - /* attempt to start lighthttpd */ - $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf"); - - /* fire up another one for HTTPS if requested */ + $cert = ""; + $key = ""; if (isset($config['captiveportal']['httpslogin']) && $config['captiveportal']['certificate'] && $config['captiveportal']['private-key']) { - $cert = base64_decode($config['captiveportal']['certificate']); $key = base64_decode($config['captiveportal']['private-key']); - $fd = fopen("{$g['varetc_path']}/cert-portal.pem", "w"); if (!$fd) { printf("Error: cannot open cert-portal.pem in system_webgui_start().\n"); @@ -179,12 +171,18 @@ EOD; fwrite($fd, "\n"); fwrite($fd, $key); fclose($fd); - - mwexec("/usr/local/sbin/mini_httpd -S -a -M 0 -E {$g['varetc_path']}/cert-portal.pem" . - " -u root -maxproc 16 -p 8001" . - " -i {$g['varrun_path']}/mini_httpd.cps.pid"); + + } + /* generate lighttpd configuration */ + system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf", + $key, $cert, "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/", + "cert-portal.pem"); + + /* attempt to start lighthttpd */ + $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf"); + /* generate passthru mac database */ captiveportal_passthrumac_configure(); /* create allowed ip database and insert ipfw rules to make it so */ -- cgit v1.1