I've always used IIS or Apache when I needed a web server in my development environment. But as a BlackBerry developer, the Ripple Mobile Environment Emulator has become a more important part of my toolkit. And the latest version includes a built in web server. So I recently put IIS on the shelf and decided to trade port 80 for port 9910.
I make regular use of virtual directories because:
- I don't want to store my web sites in wwwroot/ or htdocs/ since
- My git repo contains EVERYTHING related to a project, not just .htm, .css and .js files and I don't want it all accessible via http so
- It's cleaner to keep the repo in one location (not wwwroot/ or htdocs/) and use virdirs to point to the "website" subsection of my repo
But Ripple doesn't provide any sort of standard way to configure virdirs using a GUI or config files. Fortunately, neither of these options is required when you have Windows 7, a "Run as administrator" command prompt and the mklink command.
Here's how it works:
C:\>mklink /J siteName "C:\SomePathTo\MyRepositories\MyProject\WebRoot"
This command will create a new directory junction called
which looks and acts like a directory but is really nothing more than a pointer to the real physical location:
So that when I browse to:
it's this file gets served:
I can still keep everything related to the project in my repo, store that repo anywhere I choose on my local system and enable http access to only the web-related assets via Ripple's web server. I can develop and test and emulate my mobile brains out... without using virtual directories and without manually copying files between my repo's folder and my web server's document root folder.
This post http://ipggi.wordpress.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/ helped to clarify the difference between symbolic links, hard links, soft links and junctions.