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.  :)

5 Comments

  • good can you please hace a post on ISS life cycle

  • Urgent,
    Easy-Cgi.com told us the new IIS web server does not like original IIS system. The new IIS system will not allow run any Cgi XXX.exe any more.
    So, huge customers of Easy-Cgi.com have complained and move to Apache Web Server.
    I am a programmer long time, I wonder why IIS 7 system cause many customers to use Apache system?

    Maybe, the Easy-Cgi.com technician did not control the new IIS system

    Sorry interrupt you.

  • Decent write-up Tom. Thanks!

  • I am new to IIS. Is it safe to say that IIS is more for the developer interested in writting VB or Visual C++ programs. I really do not see a need for IIS 7 or virtual directory if you write in PHP?

    http://www.catskillit.com

  • IIS is the web server product included with Microsoft operating systems. Yes, you can run PHP with IIS, but if for some reason you did not want to use IIS you could just as well install Apache and use that to server your PHP pages.

    If you want to run ASP.NET though you have to use IIS.

Comments have been disabled for this content.