Local Development Setup Pt 1: Apache and ColdFusion (7 or 8)

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.

....
# SGB: 07.09.07 Enable mods for VirtualHosts and SSL
LoadModule 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.

#
# Use name-based virtual hosting.
#
NameVirtualHost 127.0.0.1:80

    ....

<VirtualHost 127.0.0.1:80>
    ServerAdmin username@companyname.com
    # Root folder for my scratchpad stuff
    DocumentRoot "C:\Documents and Settings\username\My Documents\wwwroot"
    ServerName username.companyname.loc
    # Alias for /CFIDE, which the CF install placed in my Apache webroot.
    # This is solely for our dev environment, and would not be a good practice
    # within a production environment
    Alias /CFIDE "C:/Program Files/Apache Group/Apache2/htdocs/CFIDE"
    <Directory "C:/Program Files/Apache Group/Apache2/htdocs/CFIDE">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog logs/username.companyname.loc-error.log
    CustomLog logs/username.companyname.loc-access.log common
</VirtualHost>

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.

TweetBacks
Comments
Louis's Gravatar Note for when installing Coldfusion 8:

"ODBC currently is only properly installed if you also install the documentation as mentioned. This will be addressed the next time we create an installer. Until then, if you need ODBC, install the documentation and ODBC. If you do not want the docs, like on a production server, delete the cfdocs directory after the install."

http://www.adobe.com/cfusion/webforums/forum/messa...
# Posted By Louis | 12/3/07 1:53 PM
Cutter's Gravatar @Louis - Thanks for the information. I, personally, never use ODBC, but I'm sure I have readers who might need it. Thanks again for the update.
# Posted By Cutter | 12/3/07 2:39 PM
Louis's Gravatar Another note for when installing Adobe Coldfusion 8:

The main jrun instances that are installed Windows Services are named:

Macromedia JRun Admin Server
Macromedia JRun CFusion Server

And any additional instances are named:

Adobe ColdFusion 8 AS sites
Adobe ColdFusion 8 AS control

And all remaining related services are named:

Coldfusion 8 [related service]

>> I'm sure I have readers who might need it. Thanks again for the update.

No problem, its my pleasure. Just trying to help. ;)
# Posted By Louis | 12/4/07 3:24 PM
Tasha's Gravatar well! very useful and informative site. thanks
# Posted By Tasha | 9/19/08 1:20 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.006. Contact Blog Owner. Layout inspired by bluerobot.com., with some JQuery thrown in for fun.