What is virtual?
A common question I see in the IIS forums is "what is a virutal directory?" or "what is a virtual server?", so I thought this might make a good topic for a blog post.
Well, let's start with the difference between a site and a directory.
A site is something like this:
A directory would be:
The word "virtual" means "being such in essence or effect though not formally recognized or admitted", or in other words, simulated.
So when used to describe servers, an example would be if the two web sites I showed were actually hosted on the same physical hardware. They wouldn't actually be two servers, but they would "virtually" appear to be running wholey independently of one another. This is done either by hosting multiple web sites in IIS through the host header feature and/or multiple IP features or by using a virtual server product, which actually hosts a whole other operating system within the server's primary OS (thereby giving you multiple full-blown server OS instances running on one physical hardware box - each server instance is therefor "virtual").
When used to desribe a directory, it essentially means a URL that doesn't physically exist under the root path but rather is mapped that way. Let's take the documents example. If you had your web root path set to C:\inetpub\wwwroot and you had a bunch of files at D:\files, you could create the virtual directory in IIS named "documents" that points to D:\files. So while C:\inetpub\wwwroot\documents doesn't actually physically exist, you could browse to http://www.mycompany.com/documents/.
On a final note, a big pet peeve of mine is the misuse of the the term virtual directory to describe a directory that has been set as an application in IIS. If this folder actually exists within the root's physical path, then there's really nothing "virtual" about it. :)