Creating Virtual Directories in Plesk
In Plesk, a virtual directory is an alias for a physical directory on your server hard drive that resides in the domain's home directory. Because an alias is usually shorter than the path of the physical directory, it is more convenient for users to type. The use of aliases is also secure because users do not know where your files are physically located on the server and therefore cannot use that information to modify your files. Aliases also make it easier for you to move directories in your site.
You can directly access the list of virtual directories for your site from Plesk > Home > domain.com > Web Directories > (to add a virtual directory) go to Add a Virtual Directory.
Rather than changing the URL for the directory, you change the mapping between the alias and the physical location of the directory.
Creating a Virtual Directory
To create a virtual directory, follow these steps:
- Click Add New Virtual Directory.
- In the Name box, type a name for the virtual directory. This is the name the user types, and should be short and easy to type.
- In the Path box, choose the name of the physical directory in which the virtual directory resides. The path should be relative to the domain's home directory.
- Select the Read checkbox to allow users to read or download files or directories and their associated properties.
- Select the Write checkbox to allow users to upload files and their associated properties to the enabled directory on your server or to change content in a Write-enabled file. Write access is allowed only when a browser that supports the PUT feature of the HTTP 1.1 protocol standard is used.
- Select the Script source access to allow users to access source code if either Read or Write permissions are set. Source code includes scripts in ASP applications.
- Select the Directory browsing box to allow users to see a hypertext listing of the files and subdirectories in this virtual directory. Because virtual directories do not appear in directory listings, users must know a virtual directory's alias. If Directory browsing is disabled and the user does not specify a file name, the Web server displays an Access Forbidden error message in the user's Web browser.
- The Execute permissions option determines the program execution level allowed for this site's resources.
- Set permissions to None to restrict access only to static files such as HTML or image files.
- Set permissions to Scripts only to allow only scripts to run, not executables.
- Set permissions to Scripts and Executables to remove all restrictions so that all file types can be accessed or executed.
- Please note: While creating a virtual directory, you configure its basic settings. Advanced configuration of a virtual directory is available afterward, when editing the properties of an existing directory.
Once added, a virtual directory is displayed in the list, accompanied by the status icons that indicate the types of permissions set for the directory. The columns are:
R - read permissions
W - write permissions
S - script source access
B - directory browsing
To set or revoke a specific permission, click the appropriate icon.
To remove a virtual directory, select the corresponding checkbox and click Remove Selected.
Editing Virtual Directories Properties
To adjust a virtual directory settings, click on its name or path in the list of virtual directories.
When you are on the page of a virtual directory properties, you can change its basic configuration described in the Creating a Virtual Directory section. You can also specify the advanced settings:
- Select the Log visits checkbox if you want the information about visiting the current directory to be logged.
- Select the Enable parent paths checkbox to allow using double period in the pathname when referring to a folder above the current virtual directory. This makes possible for users moving up the folder tree without knowing the folder name or the whereabouts in the hierarchy.
- Select the Enable to run in MTA checkbox to allow the application execution in multi-threaded apartment (MTA) mode, that may provide a slight performance boost. If the checkbox is left deselected, the application runs in single-threaded apartment.
- The Enable default content page checkbox is needed for allowing a default document for the current virtual directory. The default document is sent to a client's browser of user who accesses the directory through the Web without a specific file name (e.g. using http://www.swsoft.com, not http://www.swsoft.com/index.php). If this checkbox is deselected and Directory browsing is enabled, the Web server returns a folder listing. If it is deselected and Directory browsing is disabled, the Web server returns an "Access Forbidden" error message.
- Specify the names of files that can be used as default documents (e.g. index.html, default.html, index.php etc) in the Default documents in a search order text input field. IIS searches for the default documents in the order you defined when listed the file names, and then operates the first available file it finds. If no match is found, IIS behaves as in the cases when the default content page is disabled.
- Select the Enable anonymous access checkbox if you want to make the directory public, so that web users could access it without authentication.
- Select the Require SSL checkbox to enable SSL-only access to the directory.
Want to read this in another language?