This is an explanation on how to configure a sandbox virtual machine for website development. My reason for doing this is two fold; first, it protects my important daily work from potential desaster and secondly it allows me to develop code that will run on a different operating system. My host os is Ubuntu 8.04 but most of the work I do is run on Windows servers and because of this old code was not created with case-sensitivity in mind.
To create the sandbox vm I first created a vm using VMware Workstation 6.5 and added a shared folder to the home directory (/home). Having such a general shared directory allows anyone at work to use the VM without having to modify the location of the shared folder. In Windows, shared folders mapped this way are accessed by the
\\.host\Shared Folders\
path.This means the when I created a "webroot\test" folder for my test website the full path is
\\.host\Shared Folders\robert\webroot\test
Next, install Apache 2.2 and ColdFusion in the VM. One of the reason I chose Windows as the sandbox OS is because on Windows ColdFusion is case-insensitive, on Unix it's case-sensitive. Unfortunately, there are many websites I work on that were all written on Windows and the casing issues are appalling. After installing both Apache and ColdFusion using the defaults I setup virtual hosts. In the httpd.conf file uncomment the line
Include conf/extra/httpd-vhosts.conf
In that file, httpd-vhosts.conf add the following configuration directives
<VirtualHost *>
DocumentRoot "//.host/Shared Folders/home/robert/webroot/test"
<Directory />
Order allow,deny
Allow from all
</Directory>
ServerName test.robert-vm
ErrorLog "logs/test-error.log"
CustomLog "logs/test-access.log" common
</VirtualHost>
It is important to have the <Directory /> section because by
default the Order directive is Deny, Allow and with
no Allow from all directive you'll not have access to the
directory. The last thing is to add hostname lookups in the host files of both
the VM OS and the host OS. The two host files are found at, Windows and Linux
respectively
C:\Windows\System32\drivers\etc\hosts
/etc/hosts
After this is setup you'll be able to edit the files in your directory on the host computer but they'll be run in the sandbox of the VM.
