ASP.NET
  Home arrow ASP.NET arrow Page 2 - Setting Up Internet Information Services a...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Setting Up Internet Information Services and ASP.NET
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2005-11-10

    Table of Contents:
  • Setting Up Internet Information Services and ASP.NET
  • Managing Websites
  • Virtual Directories and Web Applications
  • Custom Errors
  • Installing ASP.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Setting Up Internet Information Services and ASP.NET - Managing Websites


    (Page 2 of 5 )

    To add more pages to your web server, you can copy HTML, ASP, or ASP.NET files directly to the c:\Intetpub\wwwroot directory. For example, if you add the file TestFile.html to this directory, you can request it in a browser through the URL http://localhost/TestFile.html. You can even create subdirectories to group together related resources. For example, the file c:\Intetpub\wwwroot\MySite\MyFile.html can be accessed through a browser using the URL http://localhost/MySite/MyFile.html. If you’re using Visual Studio .NET to create new web projects, you’ll find that it automatically generates new subdirectories in the wwwroot directory. So if you create a web application named WebApplication1, the files will be stored in c:\Inetpub\wwwroot\WebApplication1, and made available through http://localhost/WebApplication1.

    Using the wwwroot directory is straightforward, but it makes for poor organization. To properly use ASP or ASP.NET, you need to make your own virtual directory for each web application you create. With a virtual directory, you can expose any physical directory (on any drive on your computer) on your web server, as though it were located in the c:\Inetpup\wwwroot directory.

    To create virtual directories, you need to use the administrative Internet Information Services utility. To start it, select Settings -> Control Panel -> Administrative Tools -> Internet Services Manager from the Start menu on the taskbar. The next few sections walk you through the steps and explain the settings that you can configure.


    NOTE 
    This chapter is written with IIS 5 in mind. Both Windows 2000 and Windows XP use IIS 5. However, if you’re programming on Windows 2003 Server, you’ll be using IIS 6 instead. IIS 6 features a revamped request processing architecture, and a slightly tweaked user interface. You’ll be able to use most of the instructions in this chapter with IIS 6, but you may want to supplement your knowledge with the online help for IIS 6 or a dedicated book about IIS 6 administration.

    Creating a Virtual Directory

    When you’re ready to create a new website, the first step you’ll usually take is to create the physical directory where the pages will be stored (for example, c:\MySite). The second step is to expose this physical directory as a virtual directory through IIS. This means that the website becomes publicly visible to other computers that are connected to your computer. Ordinarily, a remote computer won’t be allowed to access your c:\MySite directory. However, if you map c:\MySite to a virtual directory, the remote user will be able to request the files in the directory through IIS.

    To create a new virtual directory for an existing physical directory, right-click the Default Website item in the IIS tree, and choose New -> Virtual Directory from the context menu. A wizard will start to manage the process, as shown in Figure 2-6.


    Figure 2-6.  The Virtual Directory Creation wizard

    As you step through the wizard, you’ll need to provide three pieces of information: an alias, a directory, and a set of permissions. These settings are described in the following sections.

    Alias

    The alias is the name a remote client will use to access the files in this virtual directory. For example, if your alias is MyApp and your computer is named MyServer, you can request pages using URLs such as http://MyServer/MyApp/MyPage.aspx.

    Directory

    The directory is the physical directory on your hard drive that will be exposed as a virtual directory. For example, c:\Intetpub\wwwroot is the physical directory that is used for the root virtual directory of your web server. IIS will provide access to all the allowed file types in this directory.

    Permissions

    Finally, the wizard asks you to set permissions for your virtual directory, as shown in Figure 2-7. There are several permissions you can set:

    • Read. This is the most basic permission—it’s required in order for IIS to provide any requested files to the user. If this is disabled, the client will not be able to access ASP or ASP.NET pages, or static files like HTML and images. Note that even when you enable read permission, there are several other layers of possible security in IIS. For example, some file types (such as those that correspond to ASP.NET configuration files) are automatically restricted, even if they’re in a directory that has read permission.
    • Run scripts. This permission allows the user to request an ASP or ASP.NET page. If you enable read, but don’t allow script permission, the user will be restricted to static file types such as HTML documents. ASP and ASP.NET pages require a higher permission because they could conceivably perform operations that would damage the web server or compromise security.
       
    • Execute. This permission allows the user to run an ordinary executable file or CGI application. This is a possible security risk as well, and shouldn’t be enabled unless you require it (which you won’t for ordinary ASP or ASP.NET applications).
    • Write. This permission allows the user to add, modify, or delete files on the web server. This permission should never be granted, because it could easily allow the computer to upload and then execute a dangerous script file (or at the least, use up all your available disk space). Instead, use an FTP site, or create an ASP.NET application that allows the user to upload specific types of information or files.
    • Browse. This permission allows you to retrieve a full list of files in the virtual directory, even if the contents of those files are restricted. Browse is generally disabled, because it allows users to discover additional information about your website and its structure as well as exploit possible security holes. On the other hand, it’s quite useful for testing, so you might want to enable it on a development computer.

                                        
          Figure 2-7.  Virtual directory permissions

    To host an ASP.NET application, you only need to enable the read and execute permissions (the first two check boxes). If you’re using a development computer that will never act as a live web server, you can allow additional permissions. (Keep in mind, however, this could allow other users on a local network to access and modify files in the virtual directory.) You can also change the virtual directory permissions after you have created the virtual directory.


    NOTE 
    Remember, virtual directory permissions are only used when you’re requesting a page through IIS. If you can directly access the computer’s hard drive using Windows Explorer or some other tool, these permissions won’t come into effect.

    More ASP.NET Articles
    More By Apress Publishing


       · This article is an excerpt from the book "The Definitive Guide to SAMBA 3",...
     

    Buy this book now. This article is excerpted from chapter two of the book The Definitive Guide to SAMBA 3, written by Roderick Smith (Apress, 2004; ISBN: 1590592778). Check it out at your favorite bookstore today. Buy this book now.

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek