<!--
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2018 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<refentry id="VS-S-5">
  <refmeta>
    <refentrytitle>Web Server Setup</refentrytitle>
    <refmiscinfo>tutorial</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>Examples of Mapping</refname>
    <refpurpose>Using the HTTPS client certificates</refpurpose>
  </refnamediv>

<refsect1 id="VS-S-5a">
<title>Preliminaries</title>
<itemizedlist mark="bullet">
  <listitem>The Web server can be setup to check the HTTPS client certificate</listitem>
  <listitem>The HTTPS client must have installed a X.509 certificate.</listitem>
</itemizedlist>
</refsect1>

<refsect1 id="VS-S-5b">
<title>Using the Virtual Directories UI</title>
<itemizedlist mark="bullet">
  <listitem>Login to the Conductor UI using the dba account.</listitem>
  <listitem>Go to "Web Application Server" tab and then go to the "Virtual Domains &amp; Directories" tab.</listitem>
   <listitem>In the empty fields below the list of HTTP Listeners enter:</listitem>
  <listitem>In the "HTTP Host" field the qualified name of the host.</listitem>
  <listitem>In the "Interface" field the qualified name of the interface to listen to.</listitem>
  <listitem>In the "Port" field the port number to listen on.</listitem>
  <listitem>Press the "Add" button.</listitem>
  <listitem>Define the HTTP root location of this host. The root location can be mapped in file system, DAV or proxy. This example uses the filesystem.</listitem>
  <listitem>Create a "/ssl_cv" directory under the HTTPServer ServerRoot directory. This will be used for the new mapping.</listitem>
  <listitem>Click the icon in front of the Interface value.</listitem>
  <listitem>Click the "Add new directory" link.</listitem>
  <listitem>Choose the "File System" type and press the button 'Next>>'.</listitem>
  <listitem>Enter for "Path" "/ssl_cv" and enter "/ssl_cv/" (or select with "Browse" button this directory) in the "Physical path" location.</listitem>
  <listitem>If you wish to make entire site to be executable specify the VSP user. (See also: VS-B-1 example)</listitem>
  <listitem>Select the "SSL" as "Security method"</listitem>
  <listitem><para>Enter for authentication options the files for the certificate and the private key of the server:</para>
<programlisting>
https_cert=PATH_TO_THE_CERTIFICATE;
https_key=PATH_TO_THE_PRIVATE_KEY;
https_cv=PATH_TO_THE_CA_LIST;
https_cv_depth=2;
</programlisting></listitem>
  <listitem>Press the "Save Changes" button.</listitem>
  <listitem>If needed, more path mapping can be added to the defined.</listitem>
  <listitem>To test the definition enter http://[yourhost:port]/ in location box of your browser.</listitem>
</itemizedlist>
</refsect1>

<refsect1 id="VS-S-5c">
<title>Equivalent SQL commands for above</title>
<itemizedlist mark="bullet">
  <listitem>Connect to the Virtuoso server via ISQL utility as DBA user.</listitem>
  <listitem><para>Define a virtual directory mapping for the host alias:</para>
<programlisting>SQL&gt; vhost_define (vhost=&gt;'[yourhost]:4334',lhost=&gt;'[yourhost]:4334',
             lpath=&gt;'/',ppath=&gt;'/ssl_cv/', def_page=&gt;'index.html',
		     is_brws=&gt;1, sec=&gt;'SSL',
		     auth_opts=&gt;vector ('https_cert','PATH_TO_THE_CERTIFICATE',
			 'https_key','PATH_TO_THE_PRIVATE_KEY', 'https_cv', 'PATH_TO_THE_CA_LIST',
			 'https_cv_depth', 1));</programlisting></listitem>
  <listitem>Note that in the sample SQL script, 'localhost' is used instead of 'yourhost'. This can be replaced with the official host name.</listitem>
</itemizedlist>
</refsect1>
</refentry>
