Kentico CMS 7.0 Developer's Guide

Creating a virtual directory

Creating a virtual directory

Previous topic Next topic Mail us feedback on this topic!  

Creating a virtual directory

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

If you need to install Kentico CMS manually on a remote server or restore it from backup and, at the same time, you run Kentico CMS in a sub-folder (in contrast to running Kentico CMS in the root of the website), you need to create a new virtual directory for the folder where you have the web project files.

 

 

InfoBox_Note

 

Application root

 

The root of the website or the virtual directory must be the same as the folder that contains the web.config file of Kentico CMS. This folder is called application root.

 

 

The creation of a virtual directory depends on the installed IIS version:

 

Creating a virtual directory using IIS 7.5 and 7.0

 

Since IIS 7, there exists a separate concept for a virtual directory and an application.

You can map a virtual directory to a physical directory that is located on a local or a remote computer. The physical directory (under the specified name of the virtual directory) then becomes part of the application's URL.

An application, on the other hand, is a group of files that provides services over protocols. So if you want to run your website as http://localhost/KenticoCMSDemo, you have to use an application instead of a virtual directory and specify KenticoCMSDemo as the application's alias.

 

1.Open IIS Manager

On Windows 7: Open Start -> Control Panel -> System and Security category -> Administrative Tools -> Internet Information Services (IIS) Manager.

On Windows Server 2008 or Windows Vista: Open Start -> Control Panel -> System and Maintenance category -> Administrative Tools -> Internet Information Services (IIS) Manager.

 

2.Expand local computer -> Sites -> right-click on Default Web Site (or other website if you're running multiple websites on the same computer) and choose Add Virtual Directory...

 

devguide_clip2203

 

­An Add Virtual Directory dialog appears.

 

3.Enter the Virtual Directory Alias. If you want the website to run as http://localhost/KenticoCMSDemo, enter alias KenticoCMSDemo.

 

4.Type a path or browse to the physical directory that contains the chosen directory.

 

devguide_clip2204

 

5.Click OK.

-The system creates a new virtual directory.

 

6.Right-click the virtual directory and choose Convert to Application.

-An Add Application dialog appears.

 

7.Click Select... and choose the ASP.NET v4.0 application pool from the drop-down menu.

 

devguide_clip2205

 

8.Click OK.

-The system converts the virtual directory to an application.

 

Alternatively, you can create an application in one step by right-clicking a web site and choosing Add Application... and filling the required information in the Add Application dialog as mentioned above.

 

 

Creating a virtual directory using IIS 6.0 and 5.1

 

In IIS version 6.0 and earlier, the concept of a virtual directory and an application overlaps, so creating a virtual directory is all you need to do.

 

1.Open IIS Manager

On Windows Server 2003: Open Start -> Administrative Tools -> Internet Information Services (IIS) Manager.

 
devguide_clip0056
 

On Windows XP: Open Start -> Control Panel -> Administrative Tools -> Internet Information Services.

 
devguide_clip0059

 

 

2.Expand local computer -> Web Sites -> right-click on Default Web Site (or other website if you're running multiple websites on the same computer) and choose New -> Virtual Directory....

-The Virtual Directory Creation Wizard appears. It looks the same for both operating systems.

 

3.Click Next on the first screen.

 

4.Enter the Virtual Directory Alias. If you want the website to run as http://localhost/KenticoCMSDemo, enter alias KenticoCMSDemo.

 

5.Click Next.

 

devguide_clip0060

 

6.Type a path or browse to the physical directory where the Kentico CMS web project files are placed.

-Please note that you cannot use a remote (shared) disk. The web project files are NOT the files in the C:\Program Files folder - you need to create the web project using the Kentico Web Installer first - see chapter Web Installer for details.

 

7.Click Next.

 

devguide_clip0062

 

8.Specify the access permissions for the new virtual directory. Select at least Read and Run scripts check boxes, and it's recommended that you do NOT allow any other options.

 

9.Click Next and click Finish.

 
devguide_clip0075

 

The system creates a new virtual directory. Now you need to specify its details.

 

1. Right-click the virtual directory and choose Properties.

 

2. Choose the Documents tab and make sure the Enable Default Document box is checked and the list contains the Default.aspx file.

 
devguide_clip0111

 

3. Choose the ASP.NET tab and make sure the ASP.NET version is 2.0.50727 (the last number may be different) is selected. If you cannot see the ASP.NET tab, you may not have ASP.NET 3.5 SP1 installed or registered correctly. IIS 6 may display the ASP.NET version as 2.0.50727 even if you have ASP.NET 3.5 SP1 or higher installed and registered.

 

4. Choose the Directory Security tab, click Edit in the Anonymous access and authentication control section and make sure that both Anonymous access and Integrated Windows authentication are chosen.

 

devguide_clip0133

 

5. Click OK on all dialogs to save the changes.