Basic VSP Programming tutorial
Making an Executable Directory Making an executable directory in Virtuoso's Web server space.

## Preliminaries

It is necessary to complete the configuration of the executable directory before any of the subsequent tutorials will function. It is therefore important to follow these steps carefully before trying to run the vs_b_1.vsp file.

The example demonstrated here creates an executable directory depending on either tutorial_dav.vad package was installled (i.e. the tutorials are in the DAV repository) or the tutorial_filesystem.dav package ( the tutorials have FS location.)

These tutorials are designed for use on an OpenLink Virtuoso V3.0 VDBMS. Earlier versions will not work.

Login to the Conductor UI using the dba account.

## Create the database user account vspdemo

1. Go to "System Admin" tab and then go to the "User Accounts" tab.
2. Click the "Create New Account" link.
3. Enter for Account Name "vspdemo" and a desired password with confirmation. Check the check-box for "Allow SQL/ODBC Logins". Leave the rest of the fields at their default.
4. Press the "Save" button. You will see the vspdemo now listed under current user accounts.

## Check tutorials type and path of installation (DAV or FS)

1. Go to "Database" tab and then go to the "Interactive SQL" tab.
2. Enter in the text area the following:

       select TUTORIAL_VDIR_DIR();

3. Click the "Execute" button.
4. The found result will be the tutorials Path location.
5. Click the button "Return".
6. Enter in the text area the following:

       select TUTORIAL_IS_DAV();

7. Click the "Execute" button.
8. The returned result will be the tutorials Type location: 1 - tutorials are installed in DAV, or 0 - tutorials are installed in the local FS.

## Allow VSP files to be run by vspdemo user with directory browsing allowed

1. Go to "Web Application Server" tab and then go to the "Virtual Domains & Directories" tab.
2. From the given list of HTTP Hosts click the icon in front of the Interface value.
3. Click the "Add new directory" link.
4. If tutorials Type location is FS, then choose the "File System" type and press the button "Next>>"; If tutorials Type location is DAV, then choose the "WebDAV domain" type and press the button "Next>>".
5. Enter "/vs_b_1" for Path, Enter the tutorials Path location with "/tutorial/web/" at the end for physical path (for ex. /vad/vsp/tutorial/web/ or /DAV/VAD/tutorial/web/), select "vspdemo" for the VSP user, select "Allow Directory Browsing" checkbox and then press the "Save Changes" button.

To test the new directory: enter the "http://host:port/vs_b_1" in browser. For example http://localhost:8889 as the URL. If all is ok, the content of the web tutorial directory is shown.

## Equivalent SQL commands to achieve executable directory

1. Connect to the Virtuoso server via ISQL utility as DBA user.

2. Create the user "vspdemo"

       SQL> create user vspdemo;
       SQL> user_set_qualifier ('vspdemo', 'vspdemo');

3. Create the virtual directory with user for execution "vspdemo"

       SQL> VHOST_REMOVE (vhost=>'*ini*',lhost=>'*ini*',lpath=>'/vs_b_1');
       SQL> vhost_define (vhost=>'*ini*',lhost=>'*ini*',lpath=>'/vs_b_1',
            ppath=>TUTORIAL_VDIR_DIR() || '/tutorial/web/',vsp_user=>'vspdemo', is_brws=>1, is_dav=>TUTORIAL_IS_DAV());