Creating a Virtual Directory

The default home directory for the WWW service is C:\InetPub\wwwroot. Files located in the home directory and its subdirectories are automatically available to visitors to your web site. You can create virtual directories to make web pages that are not stored in the home directory or its subdirectories available for viewing. A virtual directory appears to client browsers as if it were physically contained in the home directory. For the purposes of this chapter, in order to try out the example script you've just prepared, you should create a directory called C:\ExcelWithASP on your computer and set it up as a virtual directory.

1. Open Windows Explorer and create a new folder on your C drive named C:\ExcelWithASP

2. Right-click the ExcelWithASP folder and select Properties. The ExcelWithASP Properties box appears (see Figure 16-23).

3. Click the Web Sharing tab. A dialog box appears where you can set up an alias that users will use to access pages in that directory.

Figure 16-23: Creating a virtual directory-folder properties

EncelWilhASP Properties

Geneial 1 WebStemg] Shatinsi j Secixty j

| EwcsIWilhAS P

Location:

Seer

Sise pn dak: ConiaVis:

Fie F cider

C:\lnetpub Vwwvfloot

Obylss

Objios

Q Ffes. 0 Fofdars

Created:

Today. Angus! 11,20D2.1:5Z5G PM

Attnbuleï

Read-only Advanced.. | ¡^ Hidden

; It ; Cancel [ tipple

1

Figure 16-24:

Creating a virtual directorysharing web folder

Figure 16-24:

Creating a virtual directorysharing web folder

Figure 16-25: Creating a virtual directory—Edit Alias dialog box

Figure 16-26: Creating a virtual directory-changing the alias and setting permissions

4. Click the Share this folder option. The Edit Alias dialog box will appear. A virtual directory has an alias, a name that client browsers use to access that directory. An alias is often used to shorten a long directory name. In addition, an alias provides increased security. Because users do not know where your files are physically located on the server, they cannot modify them.

5. Enter accessDB in the Alias box, as shown in Figure 16-26. In the Access permissions area, make sure that the Read and Write permissions are selected. In the Application permissions area, make sure that the Scripts option button is selected. Click OK.

When you set up a virtual directory, it is important to specify the access permissions for that directory. The Read

Figure 16-26: Creating a virtual directory-changing the alias and setting permissions

Figure 16-27: The physical folder named ExcelWithASP will be shared over the web as accessDB.

permission allows users to access web pages. This option must be turned on so that the directory content can be viewed. The Read permission is turned on by default. The Write permission will make it possible to perform an update or some other action that g^i web stems |

alters the information in the database or creates files on the server. In addition, the Scripts permission should be turned on for virtual directories that will contain ASP pages. For the exercises in this chapter, make your Edit Alias dialog box look like Figure 16-26.

6. When you click OK in the Edit Alias dialog, a Warning dialog box will appear. Click Yes in response to the message. You should now see the alias named accessDB listed in the Aliases box (Figure 16-27).

7. Click the Security tab and set permissions for the Everyone group, as shown in Figure 16-28.

8. Click OK to close the ExcelWithASP Properties dialog box.

9. To ensure that all of the components that you need can be quickly accessed, copy the sample Northwind.mdb database file from the C:\Windows\ Program Files\Microsoft Office\Office10\Samples folder to your C:\ExcelWithASP folder.

Figure 16-27: The physical folder named ExcelWithASP will be shared over the web as accessDB.

Figure 16-28: Give the Internet Guest account (IUSR_MACHINE), which is by default part of the "Everyone" group, Write permissions on the directory containing the .mdb file.

10. Copy the AccessTbl.asp file that you created earlier to the C:\ExcelWithASP folder.

11. Right-click the North-wind.mdb file that you placed in the C:\ExcelWithASP folder, and choose Properties. When the Properties dialog box appears, click the Security tab and set up permissions for the Everyone group as shown in Figure 16-29.

Northwirtd.mdb Pioperties

General Seemly ] Sunmay |

Northwirtd.mdb Pioperties

General Seemly ] Sunmay |

Name

1

Add...

Administrators yULITTA733V\dmirBStiato

Remove

ÖSJUÜTIA733 Admins tlULITTA733\JULl-' ßJjUüTtA?BAufiasiJULITTA733\JUÜ

^.11M ITTAÎn r. Il II II

Allow Deny

Full Coritiol

Modify

B

Read I Execute

m

Read

Q

n

Write

o Allow irfieritafcle permissions Irofn paient to piopagate tc Ihis otiect o Allow irfieritafcle permissions Irofn paient to piopagate tc Ihis otiect

Figure 16-29: Give the Internet Guest account (IUSR_MACHINE), which is by default part of the "Everyone" group, Write permissions to the database file.

0 0

Post a comment