OK, so now that we are moving to localized development it has become necessary to learn how to configure our desktops for running a localized copy of our sites. The trick here is the complexity of our setup. We have multiple sites, sharing the same code base, accessing media from external resources. We also have to setup for multi-instance, to separate our front-end site and our back-end administration. We also need to be setup for one SSL site. Oh yeah, and we have to do it on Apache, since XP pro's version of IIS has some limitations about running multiple domains simultaneously. To top it all off (at least in my case) I also have to run Apache 2.0.59 so that I can also run Subversion, which is not yet compatible with Apache 2.2.

Initial setup of Apache with ColdFusion (7 or 8) is fairly straightforward by following AcidLabs ACME Guide. Follow the instructions for setup carefully, paying attention to the installation options, as it will be very important towards your setup success. In my case I did use the Apache 2.0.59 Win32 SSL Binary (MSI Installer) version. The true fun begins when it's time to 'configure' your server.

First, some basics on your Apache setup. I used the same naming convention for the server name as my machine name: username.companyname.loc. This means that, when I call the URL later on, http://username.companyname.loc, I should be able to see content if I have configured everything correctly. The ColdFusion installer handles the majority of the basic setup with Apache. But I wanted to access my CFIDE from the domain, and I wanted to have that domain (username.companyname.loc) to direct to a specific folder which I use for scratchpad-type-playaround-files. The first thing you must do is setup, within your httpd.conf file, to allow for named Virtual hosts. Find the "Dynamic Shared Object (DSO) Support" area of your Apache configuration file. The LoadModule statements are used to enable, or disable, certain features of the server. In this case, you need to enable the module for Virtual Hosts.

view plain print about
2# SGB: 07.09.07 Enable mods for VirtualHosts and SSL
3LoadModule vhost_alias_module modules/mod_vhost_alias.so

Next you will need to enable support for NameVirtualHost, and create a virtual host directive for your default administrative server. This is done at the very end of your config file. We'll also add an 'Alias', which is basically a virtual directory, that will point to your CFIDE folder.

view plain print about
2# Use name-based virtual hosting.
6    ....
9    ServerAdmin username@companyname.com
10    # Root folder for my scratchpad stuff
11    DocumentRoot "C:\Documents and Settings\username\My Documents\wwwroot"
12    ServerName username.companyname.loc
13    # Alias for /CFIDE, which the CF install placed in my Apache webroot.
14    # This is solely for our dev environment, and would not be a good practice
15    # within a production environment
16    Alias /CFIDE "C:/Program Files/Apache Group/Apache2/htdocs/CFIDE"
17    <Directory "C:/Program Files/Apache Group/Apache2/htdocs/CFIDE">
18        AllowOverride All
19        Order allow,deny
20        Allow from all
21    </Directory>
22    ErrorLog logs/username.companyname.loc-error.log
23    CustomLog logs/username.companyname.loc-access.log common

This allowed me to place an index.cfm file inside my wwwroot directory, hit it from the browser, http://username.companyname.loc, and get a valid response. It also allows me to hit my ColdFusion administrator, of my default instance, by going to http://username.companyname.loc/CFIDE/Administrator in my browser.