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; } } } include("head.inc"); ?>

vHosts: Web Server

"; //print_info_box_np("This is an info box."); //echo"
"; //endif; ?>

vHosts is a web server package that can host HTML, Javascript, CSS, and PHP. It creates another instance of the lighttpd web server that is already installed. It uses PHP5 in FastCGI mode and has access to PHP Data Ojbects and PDO SQLite. To use SFTP enable SSH from System -> Advanced -> Enable Secure Shell. Then SFTP can be used to access the files at /usr/local/vhosts. After adding or updating an entry make sure to restart the service to apply the settings.

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


0) { //sort array if (!function_exists('sort_host')) { function sort_host($a, $b){ return strcmp($a["host"], $b["host"]); } } //disable for now because it throws off the edit and delete //if (count($a_vhosts) > 1) { // usort($a_vhosts, 'sort_host'); //} foreach ($a_vhosts as $ent) { $host = $ent['host']; $port = $ent['port']; if (strlen($ent['certificate']) == 0) { $http_protocol = 'http'; } else { $http_protocol = 'https'; } if ($http_protocol == 'http' && $port == '80') { $port = ''; } if ($http_protocol == 'https' && $port == '443') { $port = ''; } if (strlen($port) > 0) { $port = ':'.$port; } $vhost_url = $http_protocol.'://'.$host.$port; ?>
Host Port SSL Enabled Description