Virtual Directories: virtdir.exe

The virtdir.exe utility is designed to manage virtual directories on domains. The utility allows the following:

Note: The functionality of virtdir.exe utility is not equal to functionality of Web Directories in Parallels Plesk Panel GUI.

 

Location

%plesk_cli%

Usage

virtdir.exe <command> [<name>] [
<option 1> <param 1>[,<param 2>,...,<param N>]
[<option 2> <param 1>[,<param 2>,...,<param N>]]
... [<option n> <param 1>[,<param 2>,...,<param N>]]
]

 

Example

The following command creates the /vd1 virtual directory on example.com as follows: it creates the physical directory in the root directory of the virtual host, maps it to the new virtual directory; allows write access to the contents of the virtual directory (including the source code), disallows read access to these resources, allows viewing the contents of the virtual directory in a browser; disables logging visits on the virtual directory; makes the virtual directory function as a web application (from the standpoint of IIS); disallows running any scripts or executables; sets no default page to display in the browser if no particular page is specified by the user; allows public access to the virtual directory; turns off SSL support for this directory.

>virtdir.exe -c /vd1 -vhost example.com -create_phys true -access_source true -access_read false -access_write true -dir_browsing true -log_visits false -create_app false -execute_perm none -default_doc false -access_anonymous true -require_ssl false

 

Commands

Command

Parameter

Description

Example

--create or -c

<name>

Creates a virtual directory with a specified name relative to the domain root directory.

To create the /vd1 virtual directory on example.com:

>virtdir.exe --create /vd1 -vhost example.com

or

>virtdir.exe -c /vd1 -vhost example.com

--update or -u

<name>

Updates parameters of a virtual directory.

To rename the virtual directory from /vd1 to /new_vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -name news

or

>virtdir.exe -u /vd1 -vhost example.com -name news

--remove or -r

<name>

Removes a virtual directory.

To remove the virtual directory /vd1 from example.com:

>virtdir.exe --remove /vd1 -vhost example.com

or

>virtdir.exe -r /vd1 -vhost example.com

--info or -i

<name>

Retrieves information about a virtual directory.

To retrieve the info about the virtual directory /vd1 referring to example.com:

>virtdir.exe --info /vd1 -vhost example.com

or

>virtdir.exe -i /vd1 -vhost example.com

--help or -h

 

Displays help on the use of the utility.

To see the help info on the use of this utility:

>virtdir.exe --help

or

>virtdir.exe -h

 

Options

Option

Parameter

Description

Example

-vhost

<host_name>

Specifies a name of a virtual host that owns a virtual directory.

Is required in all commands where a virtual directory is specified.

To enable SSL for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -require_ssl true

-create_phys

true|false

Allows/Prohibits automatically creating physical directory of the same name for a new virtual directory.

Is true by default.

Is available with --create only.

To prohibit creating the physical directory of the same name for virtual directory /vd1 on example.com:

>virtdir.exe --create /vd1 -vhost example.com -create_phys false

 

To allow creating the virtual directory /vd2 within /vd1 and a physical directory of the same name on example.com:

>virtdir.exe --create /vd1/vd2 -vhost example.com -create_phys true

-name

<relative_name>

Specifies a new name when it is necessary to rename a virtual directory.

Is available with --update only.

To rename the /vd1/vd2 virtual directory to /vd1/news on example.com:

>virtdir.exe --update /vd1/vd2 -vhost example.com -name news

-path

<relative_path>

Specifies a path of a physical directory mapped by a virtual directory.

The path is specified relative to the root directory of the domain that owns this physical directory.

Is / by default.

To redirect the /vd1/vd2 virtual directory from /vd1/vd2 to / on example.com:

>virtdir.exe --update /vd1/vd2 -vhost example.com -path /

-access_source

true|false

Enables/Disables accessing source code of ASP applications (residing within a specified virtual directory and its non-virtual subfolders) with read/write permissions (if set).

Is false by default.

To enable reading scripts of ASP applications of the /vd1 virtual directory on example.com:

>virtdir.exe --update /vd1 -vhost example.com -access_read true -access_source true

-access_read

true|false

Enables/Disables read access permissions to files located within a specified virtual directory.

Is true by default.

To disable read access to files of the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -access_read false

-access_write

true|false

Enables/Disables write access permissions on files located within a specified virtual directory.

Is false by default.

To enable write access permissions on files of the /vd1 virtual directory on example.com:

>virtdir.exe --update /vd1 -vhost example.com -access_write true

-dir_browsing

true|false

Enables/Disables user to see files and nested directories of a specified virtual directory in a browser.

Is false by default.

To enable browsing the structure of the /vd1 virtual directory on example.com:

>virtdir.exe --update /vd1 -vhost example.com -dir_browsing true

-log_visits

true|false

Enables/Disables logging user to visit a specified virtual directory.

Is true by default.

To enable logging user to visit the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -log_visits true

-create_app

true|false

Enables/Disables creating a virtual directory as an IIS application.

Is true by default.

To disable creating the virtual directory /vd1 as an IIS application on example.com:

>virtdir.exe --update /vd1 -vhost example.com -create_app true -run_in_mta false

-execute_perm

<none|script|script_execute>

Specifies the execution permission level for files located within a specified virtual directory.

If set to none, allows the display of static files (HTML, images, etc.) only.

If set to script, allows the execution of scripts only.

If set to script_execute, allows the execution of all files, including scripts and executables.

To restrict the running of executables, but allow all other files of the virtual directory /vd1 on the domain example.com to execute:

>virtdir.exe --update /vd1 -vhost example.com -execute_perm script

-parent_paths

true|false

Enables/Disables active scripts of a specified virtual directory to use relative paths to access its parent directories (using the .. syntax).

If set to true, it is recommended that the -execute_perm option is set to none.

Is available with the -create_app option set to true only.

To enable access to parent directories of the virtual directory /vd1 on example.com by a relative path:

>virtdir.exe --update /vd1 -vhost example.com -execute_perm none -parent_paths true

-run_in_mta

true|false

Enables/Disables running the IIS application (located in a specified virtual directory) in the multithreaded apartment (MTA).

Is available with the -create_app option set to true only.

To set the IIS application stored in the virtual directory /vd1 on example.com to be executed in a dedicated process (STA):

>virtdir.exe --update /vd1 -vhost example.com -create_app true -run_in_mta false

-default_doc

true|false

Enables/Disables displaying a default page when a user enters a specified virtual directory with no particular file name specified.

If it is set to false, no default page is used and two cases are possible:

- if the -dir_browsing option is true, a list of all files and nested directories in FTP style is displayed;

- if -dir_browsing option is false, the

Access forbidden

message is displayed.

To disable displaying a default file and listing the contents for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -dir_browsing true -default_doc false

-default_doc_order

<doc 1>,<doc 2>,…,<doc N>

Specifies the prioritized list of default pages for IIS to search within the virtual directory.

The first match is displayed. If no match is found, displayed is the list of all files and nested folders in FTP style.

The option is available with the -default_doc option enabled.

To specify the default pages list for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -default_doc true -default_doc_order index.html,page1.html

-access_anonymous

true|false

Enables/Disables public access to the virtual directory.

If true, the user can access the directory without authentication.

To restrict access to the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -access_anonymous false

-require_ssl

true|false

Enables/Disables SSL access to the virtual directory.

If true, the virtual directory can be accessed via SSL only.

To enables SSL access to the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -require_ssl true

-php_version

4|5

Specifies the PHP version.

Is 4 by default.

To select PHP5 support for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -php_version 5

-asp.net_version

1.1|2.0

Specifies the ASP.NET version.

Is available with -create_app option enabled and ASP.NET supported on the domain.

To select ASP.NET version 2.0 for web applications located in the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -create_app true -asp.net_version 2.0

-aspBufferingLimit

<KB>

Limits the size of ASP buffer assigned to a specified virtual directory.

Available since Parallels Plesk Panel 8.3.

To restrict the maximum size of the ASP buffer available for virtual directory /vd1 on example.com to 1 MB:

>virtdir.exe --update /vd1 -vhost example.com -aspBufferingLimit 1024

-aspMaxRequestEntityAllowed

<KB>

Limits the size of ASP request entity body.

Available since Parallels Plesk Panel 8.3.

To restrict the maximum size of ASP request entity body available for the virtual directory /vd1 on example.com to 3 MB:

>virtdir.exe --update /vd1 -vhost example.com -aspMaxRequestEntityAllowed 3072

-aspEnableServerDebug

<true|false>

Enables/Disables ASP server-side script debugging.

If it is a root directory, default value is defined by IIS; else inherited by parent directory.

Available since Parallels Plesk Panel 8.3.

To enable server-side script debugging for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -aspEnableServerDebug true

-aspEnableClientDebug

<true|false>

Enables/Disables ASP client-side script debugging.

If it is a root directory, default value is defined by IIS; else inherited by parent directory.

Available since Parallels Plesk Panel 8.3.

To enable client-side script debugging for the virtual directory /vd1 on example.com:

>virtdir.exe --update /vd1 -vhost example.com -aspEnableClientDebug true

 

 

Leave your comments on this page