New Toronto Group
 - New Toronto Group

Virtual directories with RippleSites? Sort of, sure.

| Posted on October 16th, 2012 by Rod Nolan


By Rod Nolan - consultant

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:

  1. I don't want to store my web sites in wwwroot/ or htdocs/ since

  2. 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

  3. 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:\>cd \Users\\RippleSites
C:\>mklink /J siteName "C:\SomePathTo\MyRepositories\MyProject\WebRoot"

This command will create a new directory junction called
siteName

in:
C:\Users\\RippleSites\

which looks and acts like a directory but is really nothing more than a pointer to the real physical location:
C:\SomePathTo\MyRepositories\MyProject\WebRoot

So that when I browse to:
http://localhost:9910/siteName/index.html

it's this file gets served:
C:\SomePathTo\MyRepositories\MyProject\WebRoot\index.html

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.

 

Posted in directory junction, mklink, Ripple, Rod Nolan, virtual directory  | Comments (0)

Comments (0)


Add a Comment





To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey

Allowed tags: <b><i><br>Add a new comment: