virtual directories/physical directories in IIS

  • Thread starter Thread starter Paul F
  • Start date Start date
P

Paul F

Im confused about the difference(s) between virtual directories and
physical
directories in IIS.

Any ideas?
 
A physical directory, i.e., a directory in your hard drive, can be pointed to by
IIS to configure a virtual directory, i.e., a directory that anybody can access
from outside your computer via http.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
May be my question wasnt quite clear, In Microsoft Internet Manager,
which
is the UI for IIS you can have physical and virtual directories inside
the
default web site, i want to know the difference between the two
structures
there
 
re:
!> you can have physical and virtual directories inside the default web site

You can not only have them inside the default website,
but you can also have them inside any web application.

I assume that you mean something like this :

--root directory
-- physical subdirectory of the root which is not configured as a virtual directory
-- physical subdirectory of the root which *is* configured as a virtual directory

Basically, the difference is that any web.config in a physical subdirectory cannot
contain references to MachineToApplication configuration sections, while in
virtual directories you can override MachineToApplication configuration sections.

To see which configuration sections are MachineToApplication ones, open the file machine.config.comments
with Notepad, or any other pure text editor, and search for the text "MachineToApplication".

Those configuration sections can only be configured when the application's web.config is in a
directory configured as a virtual directory, and cannot be configured in physical subdirectories.

Any section in machine.config marked as "MachineToWebRoot" can only be configured in the Application's root.
Any section in machine.config marked as "MachineOnly" can only be configured once for the whole server.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
A physical directory is a directory that exists under the directory that the
web site is bound to. For example: inetpub\wwwroot (url would be
http://localhost) is the location the web site is pointing to.
inetpub\wwwroot\mydirectory is physically under that directory (url would be
http://localhost/mydirectory).

A virtual directory could be any directory that can be seen by the server.
let's say you had a bunch of files in a directory called d:\myfiles. You can
create a virtual directory called MyFiles in your web site (url would be
http://localhost/myfiles). To anyone browsing to that directory through the
web site, it behaves as if it's located within the web.

Easiest way to think of it is a shortcut folder for web servers.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
 
Back
Top