From 98b50f46c2d617766024c5b0941cdf12c8c8937d Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 21 Dec 2009 20:14:49 -0700 Subject: vHosts web server package add SSL support. --- config/vhosts/vhosts_php.tmp | 85 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 19 deletions(-) (limited to 'config/vhosts/vhosts_php.tmp') diff --git a/config/vhosts/vhosts_php.tmp b/config/vhosts/vhosts_php.tmp index 41ccf11f..43823dd1 100644 --- a/config/vhosts/vhosts_php.tmp +++ b/config/vhosts/vhosts_php.tmp @@ -31,12 +31,42 @@ require("guiconfig.inc"); require("/usr/local/pkg/vhosts.inc"); $a_vhosts = &$config['installedpackages']['vhosts']['config']; - +$a_service = $config['installedpackages']['service']; if ($_GET['act'] == "del") { if ($_GET['type'] == 'php') { if ($a_vhosts[$_GET['id']]) { - unset($a_vhosts[$_GET['id']]); + //get vhost info + $x = 0; + foreach($a_vhosts as $rowhelper) { + if ($_GET['id'] == $x) { + print_r ($rowhelper); exit; + $id = $x; //return the id + $host = $rowhelper['host']; + $ipaddress = $rowhelper['ipaddress']; + $port = $rowhelper['port']; + $directory = $rowhelper['directory']; + if (strlen($certificate) > 0) { + $ssl = true; + } + else { + $ssl = false; + } + } + $x++; + } + //delete vhosts entry + unset($a_vhosts[$_GET['id']]); + + //delete the SSL service + if ($ssl) { + unlink_if_exists("/var/etc/lighty-vhosts-".$ipaddress."-".$port."-ssl.conf"); + unlink_if_exists("/usr/local/etc/rc.d/vhosts-".$ipaddress."-".$port."-ssl.sh"); + $service_id = get_service_id ($a_service, 'rcfile', "vhosts-".$ipaddress."-".$port."-ssl.sh"); + if (is_int($service_id)) { + unset($a_service[$service_id]); + } + } write_config(); header("Location: vhosts_php.php"); exit; @@ -51,7 +81,7 @@ include("head.inc"); -

vHosts:

+

vHosts: Web Server

@@ -88,7 +118,9 @@ include("head.inc");
@@ -98,19 +130,19 @@ include("head.inc");

- vHosts is a web server package that can host HTML, Javascript, CSS, and PHP. It uses the lighttpd web server that is already installed. It uses PHP5 in FastCGI mode and has access to PHP Data Ojbects and PDO SQLite. + vHosts is a web server package that can host HTML, Javascript, CSS, and PHP. It uses the lighttpd web server + that is already installed. It uses PHP5 in FastCGI mode and has access to PHP Data Ojbects and PDO SQLite. + After adding or updating and entry make sure to restart the service to apply the settings.

For more information see: http://doc.pfsense.org/index.php/vhosts

- - - - + + + + + + ' target='_blank'>  + + - +
HostEnabledDescription - - - - - - -
- -
HostPortSSLEnabledDescription + + + + + +
+
-   +   + +
+ +
+
+   @@ -161,7 +208,7 @@ include("head.inc"); ?>
-- cgit v1.2.3