virtdir.exe: Virtual Directories
The virtdir.exe
utility is designed to manage virtual directories on domains. The utility allows the following:
- creating, configuring, and removing a virtual directory
- setting read and write access permissions for a virtual directory
- creating a virtual directory as an IIS application and managing the application settings
- managing virtual directory security
- specifying which version of ASP.NET and PHP to use for a virtual directory
- configuring ASP (for example, enabling script debugging)
Note: The functionality of virtdir.exe
utility is not equal to functionality of Web Directories in Plesk GUI.
Location
%plesk_cli%
Usage
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.
Commands
Command | Parameter | Description | Example |
---|---|---|---|
|
|
Creates a virtual directory with a specified name relative to the domain root directory. |
To create the virtdir.exe --create /vd1 -vhost example.com or virtdir.exe -c /vd1 -vhost example.com |
|
|
Updates parameters of a virtual directory. |
To rename the virtual directory from virtdir.exe --update /vd1 -vhost example.com -name news or virtdir.exe -u /vd1 -vhost example.com -name news |
|
|
Removes a virtual directory. |
To remove the virtual directory virtdir.exe --remove /vd1 -vhost example.com or virtdir.exe -r /vd1 -vhost example.com |
|
|
Retrieves information about a virtual directory. |
To retrieve the info about the virtual directory virtdir.exe --info /vd1 -vhost example.com or virtdir.exe -i /vd1 -vhost example.com |
|
|
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 |
---|---|---|---|
|
|
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 virtdir.exe --update /vd1 -vhost example.com -require_ssl true |
|
|
Allows/Prohibits automatically creating physical directory of the same name for a new virtual directory. Is Is available with |
To prohibit creating the physical directory of the same name for virtual directory virtdir.exe --create /vd1 -vhost example.com -create_phys false
To allow creating the virtual directory virtdir.exe --create /vd1/vd2 -vhost example.com -create_phys true |
|
|
Specifies a new name when it is necessary to rename a virtual directory. Is available with |
To rename the virtdir.exe --update /vd1/vd2 -vhost example.com -name news |
|
|
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 |
To redirect the virtdir.exe --update /vd1/vd2 -vhost example.com -path / |
|
|
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 |
To enable reading scripts of ASP applications of the virtdir.exe --update /vd1 -vhost example.com -access_read true -access_source true |
|
|
Enables/Disables read access permissions to files located within a specified virtual directory. Is |
To disable read access to files of the virtual directory virtdir.exe --update /vd1 -vhost example.com -access_read false |
|
|
Enables/Disables write access permissions on files located within a specified virtual directory. Is |
To enable write access permissions on files of the virtdir.exe --update /vd1 -vhost example.com -access_write true |
|
|
Enables/Disables user to see files and nested directories of a specified virtual directory in a browser. Is |
To enable browsing the structure of the virtdir.exe --update /vd1 -vhost example.com -dir_browsing true |
|
|
Enables/Disables visits logging of a specified virtual directory in a browser. Is |
To turn of visits logging for the website (virtual directory virtdir.exe --update /vd1 -vhost example.com -log_visits false |
|
|
Enables/Disables creating a virtual directory as an IIS application. Is |
To disable creating the virtual directory virtdir.exe --update /vd1 -vhost example.com -create_app true -run_in_mta false |
|
|
Specifies the execution permission level for files located within a specified virtual directory. If set to If set to If set to |
To restrict the running of executables, but allow all other files of the virtual directory virtdir.exe --update /vd1 -vhost example.com -execute_perm script |
|
|
Enables/Disables active scripts of a specified virtual directory to use relative paths to access its parent directories (using the .. syntax). If set to Is available with the |
To enable access to parent directories of the virtual directory virtdir.exe --update /vd1 -vhost example.com -execute_perm none -parent_paths true |
|
|
Enables/Disables running the IIS application (located in a specified virtual directory) in the multithreaded apartment (MTA). Is available with the |
To set the IIS application stored in the virtual directory virtdir.exe --update /vd1 -vhost example.com -create_app true -run_in_mta 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 - if the - if |
To disable displaying a default file and listing the contents for the virtual directory virtdir.exe --update /vd1 -vhost example.com -dir_browsing true -default_doc false |
|
|
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 |
To specify the default pages list for the virtual directory virtdir.exe --update /vd1 -vhost example.com -default_doc true -default_doc_order index.html,page1.html |
|
|
Enables/Disables public access to the virtual directory. If |
To restrict access to the virtual directory virtdir.exe --update /vd1 -vhost example.com -access_anonymous false |
|
|
Enables/Disables Windows authentication for users accessing the virtual directory. |
To restrict access to the virtual directory virtdir.exe --update /vd1 -vhost example.com -access_windows false |
|
|
Enables/Disables SSL access to the virtual directory. If |
To enables SSL access to the virtual directory virtdir.exe --update /vd1 -vhost example.com -require_ssl true |
|
|
Specifies the PHP version.
|
To select PHP 5.4 support for the virtual directory virtdir.exe --update /vd1 -vhost example.com -php_version 5.4 |
|
|
Specifies the ASP.NET version. Is available with |
To select ASP.NET version 4.0 for web applications located in the virtual directory virtdir.exe --update /vd1 -vhost example.com -create_app true -asp.net_version 4.0 |
|
|
Sets MIME types for the specified directory. For example: 'text/plain .txt image/jpeg .jpeg'. |
To set custom MIME types and access by IP addresses for the website (virtual directory virtdir.exe --update /vd1 -vhost example.com --mime-types "image/jpeg .jpg" -ip_deny 192.168.1.0/16 -ip_allow 192.168.1.11
|
|
|
Sets a list of IP addresses that will be denied access to the specified website. Use spaces to separate IP addresses. For example: '10.1.0.0/16 192.168.1.110'. |
|
|
|
Sets a list of IP addresses that will be allowed to access the specified website. Use spaces to separate IP addresses. For example: '192.168.0.0/16 10.1.1.21'. |
|
|
|
Limits the size of ASP buffer assigned to a specified virtual directory.
|
To restrict the maximum size of the ASP buffer available for virtual directory virtdir.exe --update /vd1 -vhost example.com -aspBufferingLimit 1024 |
|
|
Limits the size of ASP request entity body.
|
To restrict the maximum size of ASP request entity body available for the virtual directory virtdir.exe --update /vd1 -vhost example.com -aspMaxRequestEntityAllowed 3072 |
|
|
Enables/Disables ASP server-side script debugging. If it is a root directory, default value is defined by IIS; else inherited by parent directory.
|
To enable server-side script debugging for the virtual directory virtdir.exe --update /vd1 -vhost example.com -aspEnableServerDebug true |
|
|
Enables/Disables ASP client-side script debugging. If it is a root directory, default value is defined by IIS; else inherited by parent directory. |
To enable client-side script debugging for the virtual directory virtdir.exe --update /vd1 -vhost example.com -aspEnableClientDebug true |
|
|
Sets dynamic denying of IP addresses based on the number of concurrent HTTP requests. Applies to the root virtual directory. This restriction can be used together with the restriction based on the number of HTTP requests over a period of time. Learn more at http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions |
To make IIS deny access to the site example.com from clients that have made more than 9 concurrent HTTP requests: virtdir.exe --update / -vhost example.com -is_deny_by_concurrent_requests true -max_concurrent_requests 9
|
|
|
Sets the maximum number of concurrent requests. Is Is used with the |
|
|
|
Sets dynamic denying of IP addresses based on the number of requests over a period of time. Applies to the root virtual directory. Learn more at http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions |
To make IIS deny access to the site example.com from clients that have made more than 22 HTTP requests in 230 milliseconds: virtdir.exe --update / -vhost example.com -is_deny_by_request_rate true -max_requests 22 -request_interval 230 |
|
|
Sets the maximum number of requests. Is Is used with the |
|
|
|
Sets a time period (in milliseconds). Is Is used with the
|