Home Technique Virtual directory

Virtual directory



Note

The virtual directory does not appear in the directory list (also known as the "directory browsing" of the http://www. service). To access the virtual directory, the user must know the alias of the virtual directory and type the URL in the browser. For the http://www. service, it can also create a link in the HTML page. For gopher services, a clear link can be created in the flag file so that users can access the virtual directory. For FTP services, you can use directory comments to list virtual directories.

About the apache virtual directory alias

About the apache virtual directory, the documentRoot in the apache config file is the root directory when apache is parsing the page. If it is on the machine at the same time There are two working directories. If it is not an alias directory, you need to constantly modify the path of the documentroot and restart apache, which is quite troublesome. One way to solve this problem is to set a virtual directory. The specific method is as follows:

< p>Alias ​​/virtual directory name/ "drive letter: /path/"

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

IIS virtual directory

1. Before creating a virtual directory, we first create a folder where you need it. Here I will create a new folder in the D drive of my computer.

2. Since our tutorial explains how to set up a guestbook, then we will name this folder "GuestBook".

3. Next, we open "Internet Information Services" under the control panel-management tools directory. Right-click "New-Virtual Directory" after selecting the default site.

4. When the virtual directory creation wizard appears, click Next.

5. In the virtual directory alias dialog box, enter "GuestBook" and click Next to continue.

6. In the website content directory settings, click Browse to select the "GuestBook" directory we just created on Disk D, and click Next to continue.

7. Keep the default in the access permission settings, and click Next to continue.

8. Finally, the completion dialog box appears, click Finish.

9. After completion, you will see the virtual directory you just created in the Internet Information Service. The icon of the virtual directory is an open box.

10. After creating the virtual directory, we need to test whether the virtual directory is operating normally. We open the location of your virtual directory, which is the GuestBook directory of D drive, and create a new text file in this directory.

11. After creating it, we will rename this text file to "index.asp".

12. After renaming, we use Notepad to open the file named "index.asp", and then enter the following code in the file. The meaning of this code is to get the current system time. This is a simple ASP code. After input, we save the file.

13. Then we go to IIS and click the virtual directory "GuestBook" just created. You will see that there is a file named "index.asp" in the directory.

14. Select the "index.asp" file, right-click, and select browse. 17. You will see the results of the operation. At this point, your IIS virtual directory is perfectly successful.

Web virtual directory

The virtual directory in the Web server needs to be created on the basis of the home directory:

Step 1, click in the start menu in turn "Management Tools" → "Internet Information Service (IIS) Manager" menu item, open the "Internet Information Service (IIS) Manager" window. Expand the server→"Website" directory in the left pane, right-click the website name, and select the "New"→"Virtual Directory" command in the pop-up shortcut menu.

Step 2, click the "Next" button in the opened "Virtual Directory Creation Wizard" to open the "Virtual Directory Alias" dialog box. Then enter a name that reflects the purpose of the virtual directory (such as MsserverBook) in the "Alias" edit box, and click the "Next" button.

Step 3, open the "Website Content Directory" dialog box, where you need to specify the path where the virtual directory is located. Click the "Browse" button and select the target directory in the local disk or network neighborhood. The virtual directory and the home directory of the website may not be in the same partition or physical disk. Click "OK" → "Next" button in turn.

Step 4, in the opened "Virtual Directory Access Permissions" dialog box, you can set the access permissions that the virtual directory is going to give users. Users can set appropriate permissions according to actual needs and click the "Next" button.

Step 5, open the completion of the virtual directory creation dialog box, click the "Finish" button to close the virtual directory creation wizard.

FTP virtual directory

FTP virtual directory can be used as a subdirectory under the main directory of the FTP site, although these virtual directories are not subdirectories in the true sense of the main directory. In essence, the virtual directory is to create a subdirectory under the root directory of the FTP site, and then point this subdirectory to any directory on the local disk or a shared folder on the network. The steps to create a virtual directory are as follows:

Step 1, open the "Internet Information Services (IIS) Manager" window, and expand the "FTP site" directory in the left pane. Right-click the name of the created FTP site and select the "New" → "Virtual Directory" command in the pop-up shortcut menu. Open the "Virtual Directory Creation Wizard" dialog box, and click the "Next" button directly in the welcome dialog box.

Step 2, in the opened "Virtual Directory Alias" dialog box, the user needs to set the name used when connecting to the virtual directory. The alias of the virtual directory does not have to be the same as the name of the actual directory pointed to. Enter the virtual directory name in the "Alias" edit box and click the "Next" button.

Step 3, open the "FTP Site Content Directory" dialog box, where you need to specify the actual directory that the virtual directory points to. Click the "Browse" button to select the actual directory in the local disk, or enter the UNC path of the network shared folder in the "Path" edit box. After setting, click the "Next" button.

Small tip: If the user enters the UNC path of the shared folder in the "Path" edit box, after clicking the "Next" button, the "Security Credentials" dialog box will open, asking for permission to access Specify the username and password of the shared folder.

Step 4, in the opened "virtual directory access permissions" dialog box, you can set the directory access permissions, and the user can decide whether to select the "write" check box according to actual needs. Click the "Next" → "Finish" button to complete the creation process.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP