Microsoft KB Archive/299868

= How To Deploy an ASP Application to Another Server by Using Internet Information Server =

Article ID: 299868

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft Active Server Pages 4.0, when used with:
 * Microsoft Windows 2000 Standard Edition
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q299868



IN THIS TASK
SUMMARY
 * Requirements
 * How to Copy an ASP Application to the Destination Computer
 * How to Configure the Folder as an ASP Application
 * Test the Web Application on the New Server
 * Troubleshooting

REFERENCES



SUMMARY
This step-by-step procedure demonstrates how to copy an existing Active Server Pages (ASP) application from one computer to another computer. By the end of this article, you will be able to successfully deploy an existing, simple ASP application from one computer to another.

This article assumes that you have administrative permissions to both the source and destination computers, which are located in the same network, and that you have a simple, ASP application that does not contain Design Time Controls, database connections that rely on Microsoft Visual InterDev Data Environment or Data Source Names (DSNs), COM+ packages, or custom dynamic-link libraries (DLLs). The ASP application should be running on the source computer. If your application is more complex than this, please consider this article as a starting point and read the Pitfalls section carefully.

back to the top

Requirements
The following list outlines the required hardware and software for the source and destination computers:
 * Microsoft Windows 2000 Professional, Windows 2000 Server, or Windows 2000 Advanced Server
 * Microsoft Internet Information Server (IIS) version 5.0

Installing the Required Software
IIS 5.0 is a minimum requirement for any Web application to work on a Windows 2000-based computer. As a result, you must install IIS on the destination computer before you can proceed.

NOTE: IIS is not installed by default with Windows 2000 Professional. If you upgraded to Windows 2000, IIS 5.0 is installed by default only if Personal Web Server was installed on your previous version of Windows.

To install IIS 5.0 on an existing Windows 2000-based computer, follow these steps:  From the Windows Start menu, point to Settings, and then click Control Panel. Double-click Add/Remove Programs, and then click Add/Remove Windows Components. In the Windows Component Wizard, in the Components list box, click Internet Information Services (without changing its existing check box status as selected or cleared), and then click Details. In the Internet Information Services dialog box, select the following check boxes, if they are not already selected, and then click OK:  Common Files Documentation FrontPage 2000 Server Extensions</li> Internet Information Services Snap-in</li> World Wide Web Services</li></ul>

</li> In the Windows Components Wizard, click Next to start Windows 2000 Setup. If prompted, insert the Windows 2000 CD into the CD-ROM drive. Windows Setup copies the required files to your computer.</li> When Setup is complete, click Finish.</li></ol>

back to the top

How to Copy an ASP Application to the Destination Computer
To deploy the ASP application on the destination computer, you must first copy the ASP application files from the source computer to the destination computer. The easiest way to copy the files is to use Windows Explorer.

Locate the Source and Destination Folders on Their Respective Hard Disks
The directory structure in Internet Services Manager does not always match the directory structure on the hard disk. In Windows Explorer, you can review the hierarchy of folders on the hard disk. In Internet Services Manager, the same directories appear, but additional &quot;virtual&quot; directories appear that are not located in the same folder hierarchy on the hard disk. Thus, you must first locate where the Web application folder resides on the source and where the Web application folder will go on the destination computers. Note that this article distinguishes between &quot;directories&quot; in Internet Services Manager and &quot;folders&quot; on the hard disk.

This article is targeted to &quot;simple&quot; Web applications. The default location for Web applications (on both the source and destination computers) is C:\Inetpub\Wwwroot or a folder one level beneath this folder. If you have difficulty finding your Web application, refer to the Pitfalls section. The instructions in this article assume that your source and destination folders are either the Wwwroot folder or a folder one level beneath Wwwroot.

In addition, your Web application folder and its subfolders generally contain all the files that related to a simple ASP application. There are many exceptions to this as Web applications become more complex. Review your application to determine if there are additional files outside of this folder that need to be copied and determine where they need to copied to on the destination computer. This article assumes that all files that make up your application are in a single folder.

Share the Folder on Your Source Computer That Contains Your Web Application
You must share the ASP application folder on the source computer so that you can access it from destination computer. To share the ASP application folder on the source computer, follow these steps:
 * 1) Log on to the source computer as Administrator or a user who is in the local Administrators group.
 * 2) From the Start menu, click Run, type explorer to open Windows Explorer. Click OK.
 * 3) Select the folder in which the ASP files that you want to copy are located.
 * 4) Right-click the name of the folder that you selected in step 3. In the resultant shortcut menu, click Sharing.
 * 5) Click Share this folder, and provide a new name for the share if you want. The default name is the name of that folder.
 * 6) Click Permissions, select Everyone, make sure that the Read check box is selected and that the other check boxes are cleared, and then click OK.
 * 7) In the Sharing properties dialog box, click OK.

Create a Destination Folder and Copy the Files
To copy the contents of the shared folder from the source computer to the destination computer, follow these steps:
 * 1) On the destination computer, from the Start menu, click Run, type explorer, and then click OK. Refer to this Windows Explorer window &quot;Window A.&quot;
 * 2) In Window A, browse to your Wwwroot folder. By default, this is located at C:\Inetpub\Wwwroot.
 * 3) Your destination folder is either Wwwroot or a folder one level beneath it. If the destination folder does not exist, create a new folder one level beneath the Wwwroot folder to serve as the destination folder.
 * 4) From the Start menu, click Run, and type \\<SourceComputername>\<Sharename>, and then click OK. For example, if the source computer name is &quot;ComputerA&quot; and you created a share called &quot;ASP&quot; on that computer, type \\ComputerA\ASP . If you are prompted for a user name and password to connect to the source computer, type the user name as Administrator or any other user who is in the Administrators group on the source computer, type the password, and then click OK. If the user name and password that you supplied are correct, a window displays the files and folders on that shared folder. Call this window &quot;Window B.&quot;
 * 5) Select all of the files and folders from Window B. To select all of the files and folders, click in the blank area of Window B, and press the CTRL+A key combination. Then press CTRL+C to copy all of the files and folders.
 * 6) In Window A, right-click the destination folder, and then click Paste. This copies all of the files and folders that you selected in Window B to the new folder.
 * 7) After you successfully copy the application and related files and folders, you must remove the share(s) that you created on the source computer.

Remove the Share from the Source Computer
To remove the shared folder from the source computer, follow these steps:
 * 1) Log on to the source computer as Administrator or a user who is in the local Administrators group.
 * 2) From the Start menu, click Run, type explorer, and then click OK.
 * 3) Locate the shared folder.
 * 4) In the left pane of Windows Explorer, right-click the folder that you selected in step 3, and then click Sharing in the resultant shortcut menu.
 * 5) In the Properties dialog box, click Do not share this folder, and then click OK.

back to the top

How to Configure the Folder as an ASP Application
To configure the folder as an ASP application, follow these steps:
 * 1) From the Start menu, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
 * 2) In the Internet Services Manager, double-click the destination computer name.
 * 3) If necessary, double-click to expand your Web site so that you can view the directories one level beneath it. Within Internet Services Manager, your Web site is named Default Web Site by default.
 * 4) The directories are not always listed in alphabetical order. If your directory is not listed, close and re-open Internet Services Manager, and look again. This updates Internet Services Manager with the most recent changes.
 * 5) In Internet Services Manager, right-click your directory, and then click Properties.
 * 6) On the Directory tab, locate the Create or Remove button. If the button is labeled Remove, proceed to the next step. If the button is labeled Create, click it.
 * 7) On the Directory tab, click Scripts Only in the Execute Permissions drop-down list box, and then click Configuration.
 * 8) On the App Options tab, select or clear the Enable Session State check box depending on whether you use session variables in your Web application.

If you select the Enable Session State check box, you must also type the number of minutes that a session is kept in memory on the server. If users browse to an ASP page in your application, they start a session. If they do not browse to additional ASP pages in your application (they become inactive), their session variables are purged after this amount of time.
 * 1) Click OK to return to the Properties dialog box.
 * 2) Click the Documents tab. This tab determines which page is used if users type the URL to your Web application without specifying a page. You may enable or disable this option, and you may add or remove items from the list of pages. If you enable this option, IIS looks for the first page that is listed. If IIS cannot find this page, it looks for the second page, and so on.
 * 3) Click OK to save your changes and close the Properties dialog box.
 * 4) Close Internet Services Manager. Deployment is complete.

back to the top

Test the Web Application on the New Server
To verify that the deployed ASP application works on the destination computer, follow these steps:
 * 1) From the Start menu, click Run, type http://<destinationComputerName>/<yourApplicationName>/, and then click OK.
 * 2) The default page for your application appears in the browser.
 * 3) Try to browse to other pages in the application. If you receive any error messages, refer to the Pitfalls section.

back to the top

Troubleshooting
The preceding sections describe how to deploy a very simple Web application. This section provides a basic description of some areas that are beyond the scope of the main section of this article. <ul> Some files are missing: Sometimes, other files need to be copied in addition to the files in the main Web application folder on the hard disk. <ul> Virtual directories: The most common reason for missing files after you copy the Web application folder is that the Web application includes virtual directories.

In Internet Services Manager, look for subdirectories below your Web application directory. To determine if a subdirectory is a virtual directory, verify that the &quot;path&quot; column in the right pane of Internet Service Manager contains the path to the folder on the hard disk. In regular directories, the &quot;path&quot; column is blank.

Make sure that you copy these virtual directories to the destination computer. When you create a folder on the destination computer to receive these files, if you create this folder outside of the Web application folder, you must create a virtual directory in Internet Services Manager that points to it.</li> Other content: If you find that an element of a page is missing, click View Source in your Web browser, and look at the ASP source on the server. From this, you should be able to find the reference that is failing. Look for the item in Internet Services Manager. You may find that the path in your source points to a location outside your Web application directory. The missing files must be located on the source computer and copied to the destination computer.</li></ul> </li> Deploying components: If your Web application uses ActiveX or Component Object Model (COM) components (controls, OCX files, DLL files or EXE files), these components must also exist on the destination computer. If they do not already exist on the destination computer, you must copy them from the source computer. Although copying components is beyond the scope of this article, this list provides some brief notes: <ul> Controls and OCX files: Copy the CAB file that the CodeBase attribute specifies in your Web pages.</li> DLL and EXE files: Most ActiveX EXE files register themselves if you copy the EXE and double-click it to run it on the server. For DLLs, you can copy and register the DLL. To register the DLL, click Run from the Start menu, and type regsvr32 <full path and file name of your DLL>.

If these methods fail, you must install the DLL/EXE with an installation or setup program. If you purchased the component, a setup program should be included with the component. If you wrote the component, the language that you used to create the component should have a method for creating a setup program. For example, Microsoft Visual Basic comes with a deployment tool named Package and Deployment Wizard. Microsoft Visual C++ comes with a deployment tool named Install Shield.</li></ul> </li> Session and application variables are blank or empty: For additional information about the most likely cause for this problem, click the article number below to view the article in the Microsoft Knowledge Base:

265275 FP2000: Global.asa Does Not Run in FrontPage Web

</li> Database connectivity: This is beyond the scope of this article. In general, your Web application uses a connection string to find your database and connect to it. If you use ODBC connectivity, you must set up another element called a data source name (DSN) within the ODBC Data Source Administrator.For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

208304 ACC2000: &quot;Data Source Name Not Found&quot; Message When You Open Web Page

213846 INFO: Deploy Database Applications with the Package and Deployment Wizard (PDW)

</li></ul>

back to the top

<div class="references_section">