IIS Insider - January 2006
By Jeff Cochran, IIS MVP
IIS Insider is a monthly column designed to answer your questions on how to troubleshoot and make the most of Microsoft Internet Information Services.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, places, or events is intended or should be inferred.
DotNetNuke and Internet Information Services (IIS)
Q. I installed DotNetNuke, and it works fine on localhost, but nobody can see my pages from outside. I checked with a default.htm page, and that works. What do I need to change in IIS to get my DotNetNuke site working from a client instead of the server?
A. DotNetNuke is a popular portal framework that uses ASP.NET and runs on IIS. The symptoms you describe are similar to what can occur with IIS if your Web site is set to answer only on the localhost IP address, 127.0.0.1, or if your Web site is set to redirect to a URL, http://localhost/. However, in this case, it�s actually a DotNetNuke setting that needs to be changed.
DotNetNuke uses a technique called URL redirection to direct client requests to the proper portal and page. This redirection relies on the requested URL, sort of like host headers, but on an application level. The problem you describe occurs when DotNetNuke is installed using one URL, and an attempt to access it is made using a different URL (for example: installing it from http://localhost/ and trying to access it from http://adatum.com).
To fix this issue, add a Portal Alias in DotNetNuke for the URL being requested:
Log on to your DotNetNuke portal with the Host account, and click the Admin menu.
From the drop-down menu, choose Site Settings menu.
Under Portal Aliases, choose Add New HTTP Alias, and type the URL you want to use to access this portal. (For example, if you wanted this DNN portal accessed as adatum/dnn, you would add that as an alias.)
If your browser does not support inline frames, click here to view on a separate page.
Note: DotNetNuke is a registered trademark of Perpetual Motion Interactive Systems, Inc.
Redirecting Web Requests to an IP Address
Q. I have a Web site at a hosting company, but I want to host it myself. I have IIS working with my IP address assigned by my ISP. What do I need to do to access my Web site as http://www.widgets-inc-10.com?
A. IIS services Web requests directed to a specific IP address. IIS doesn�t acknowledge or recognize whatever name you use to access the system. Of course, it is easier for you to remember a name, such as widgets-inc-10.com, than an IP address. Domain Name System (DNS) is the mechanism that translates a friendly name to the less-friendly IP address for most of the Internet, as well as for most corporate networks.
For you to access your Web site as http://www.widgets-inc-10.com/, DNS needs to point http://www.widgets-inc-10.com to the IP address of your Web server. Specifically, a DNS server or servers that are reachable by the client computer doing the browsing provides that name resolution.
To understand how DNS works, let's take apart the example URL, http://www.widgets-inc-10.com/
http:// is the protocol that is used for the URL,
www is the host,
widgets-inc-10 is the domain, and
com is the top-level domain (TLD).
DNS is set up in a hierarchical fashion, beginning with the TLD. Finding a host address is quite simple-the system first finds the TLD, moves to the correct domain, and then goes out to the host.
The Internet has twelve root servers, each of which knows the top-level domains such as .com, .net and .org. Each TLD knows the domains over which it has authority. And each domain knows the hosts for which it has authority. On the Internet, every domain has at least one authoritative DNS server, the one that every other server will look to if it needs information about that domain. Each DNS server keeps a list of every host name, and the IP address associated with it, in every domain for which that DNS server is authoritative. You can check your specific DNS server configuration through a number of sites, such as: http://www.dnsreports.com, http://www.dnsstuff.com, and http://www.dnsgoodies.com.
When you register a domain (say, http://www.widgets-inc-10.com), one of the pieces of information you have to provide is the name and IP address of a DNS server that will be authoritative for the domain. That registration record is what the root servers use to determine authority over the naming and addressing in a domain.
To move the http://www.widgets-inc-10.com Web server from your hosting company to your system, you have to do two things:
Configure a DNS server that will be authoritative for the http://www.widgets-inc-10.com domain. This DNS server needs to have the www host added to the widgets-inc-10.com domain records matched to the IP address of your IIS server.
Update your name registration record to show that DNS server as the one authoritative for your domain.
You don�t have to run your own DNS server for this to work, but you can. If you don�t run your own DNS server, then whoever does run the DNS server that will be authoritative for your domain needs to make the changes. If you do run your own DNS server, then you can make the changes yourself. If all you need is the name resolution for your Web server, and if that information rarely changes (in most instances it changes only when there�s a change of service provider), then it�s usually more convenient to have your ISP or name registrar handle your DNS.
For more information about running your own DNS server, see:
How To Install and Configure DNS Server in Windows Server 2003
How To Configure DNS Records for Your Web Site in Windows Server 2003
Creating an Application Root in a Virtual Directory
Q. I created a new Web application and uploaded it to my hosting site, but it doesn�t work. Does it have to be a virtual directory?
A. Web applications do not need to be in a virtual directory, but they do need to be in an application root. A virtual directory can be an application root, but it doesn�t have to be. Likewise, an application root can be created with a virtual directory, or in a standard directory.
Virtual directories allow content outside the normal hierarchy of a Web site�s physical folders to be served by that Web site. Think of them as pointers to where the files really are. You can create a virtual directory using the IIS Management Console.
To create a virtual directory with IIS Management Console:
Right-click the Web site and choose All Tasks, then choose New Virtual Directory.
Name the virtual directory folder.
This is the name that will show as the URL when the content is requested. For example, if you name the virtual directory folder_1, then the URL will be something like http://www.example.com/folder_1/, even if the virtual directory points to a folder named folder_2. You can take advantage of this functionality by changing where the virtual directory points without having to update your Web site links.
A virtual directory is not created as an application root by default. The only default application root on a Web site is the Web site�s root folder. All others, both standard folders and virtual directories, must be designated as application roots for an ASP.NET Web application to run correctly in them.
To create an application root in a folder or virtual directory:
In the IIS MMC, right click on the folder or virtual directory and choose Properties.
Choose the directory tab for the Application Settings section.
Click Create, and give your application a name. The default name reflects the name of the folder you are working on.
Click Okay to create an application root. The icon in the MMC should change to the application icon, a gear shape.
For convenience, and to provide more security, you can store Web application files outside the Web folder hierarchy. Files outside the Web folder hierarchy cannot be directly accessed through HTTP, and thus can�t be retrieved by a browser without being processed through a virtual directory.
Virtual directory, but not an application root:
The Create button is used to create a Web application root in a virtual directory or folder:
The default name for an application is the virtual directory or folder name, but you can type a new name:
An application root is indicated by the Gear icon:
For More Information
Submit your questions to IIS Insider. A response is not guaranteed; however, selected questions along with the answers will be posted in a future IIS Insider column.
Visit IIS Insider column archives for a list of previous months' questions and answers.
We at Microsoft Corporation hope that the information in this work is valuable to you. Your use of the information contained in this work, however, is at your sole risk. All information in this work is provided "as is," without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported, or guaranteed by Microsoft Corporation. Microsoft Corporation shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental, or consequential, even if it has been advised of the possibility of such damages.