Setting Up For Local CF8 Development with CFEclipse, Subversion(SVN) Ready

There is lots of buzz lately about Subversion(SVN) and so I decided to check it out; I'm glad I did. It is absolutely incredible and I can't believe I didn't jump on this bandwagon sooner. I've totally revamped my development environment so that I develop locally on either my desktop or notebook. The beauty of Subversion is that it is quick and easy to get the latest copy of the code on whichever computer I want to use, since I now use a centralized SVN repository. Local Development using CFEclipse and Subversion has indeed made me a more efficient coder, and comes with the bonus that it protects my code so I never lose it.

Local Web Server

Whether you're using Windows XP SP2+, Vista or MacOS X you'll want to use Apache for local Web Development. Apache allows you to have multiple sites which can be configured at virtual sites, so you can browse any one of them at any time without further configuration. IIS simply doesn't allow this on XP, and while IIS7 on Vista does, the UAC (User Access Control) feature of Vista is so screwed up, using Apache just saves you a ton of headaches.

Installing and Configuring Apache 2.2.4

Download and install Apache 2.2.4 - apache_2.2.4-win32-x86-no_ssl.msi file.

After installation of Apache, create a new folder called www on the C drive (C:\www).

Go up one level to:

C:/Program Files/Apache Software Foundation/Apache2.2/conf
Edit this file in Notepad. Here are three changes you must to do the httpd.conf:
  1. Scroll down to Document Root and change it to:
    Document Root C:/www
  2. Scroll down further to the second Directory tag and change that line to:
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory C:/www>
    Notice the comments which should be above the Directory tag you will change.

    Update on 11/27/2007: In order for things like the new AJAX features of CF8 to work properly, the CFIDE folder must be mapped correctly. Check out this new blog entry for further configuration of this httpd.conf file before the process is complete: How To Map Apache Virtual Hosts to CFIDE

  3. Scroll down near the bottom of the file and find the line that looks like this:
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    Remove the # (pound sign) to uncomment the line, like this:
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
  4. Process Complete. Restart Apache server by left-clicking the Apache Icon in the windows taskbar and selecting Apache 2>Restart.

NOTE: You can also right-click the Apache Icon and select Apache Monitor, which opens a dialog box. Then click the Restart button. This option lets you view the server stopping and restarting.

Configuring httpd-vhosts.conf on Apache

Whenever you want to add a site to browse locally for development, you have to add a VirtualHost block to the httpd-vhosts.conf file. I recommend creating a shortcut on the desktop. Here's what a typical VirtualHost block looks like
<VirtualHost *:80>
DocumentRoot "C:/www/localhost"
ServerName localhost
DirectoryIndex index.cfm
</VirtualHost>
This block is for localhost, which is actually a folder in your webroot (located at C:\www\localhost. For each folder you add to the webroot, you need to copy and paste the previous block of code and then configure it. It is pretty logical. Servername is the actual URL you'll type in the browser. DirectoryIndex is the default document type.

Configuring HOSTS

The next step is to browse to your HOSTS file in Windows Explorer located:
C:/WINDOWS/SYSTEM32/DRIVERS/ETC
I recommend creating a shortcut to this file on your desktop.

In this file you just add a new line for each site you add. The IP is always local, 127.0.0.1

127.0.0.1 localhost
127.0.0.1   siteNameLocal

Installing ColdFusion 8 Dev Edition

Download CF8 Dev Edition and CF8 Extensions for Eclipse from Adobe.com ColdFusion Download Site (AdobeId Required)

Export CF8 Beta Settings

If you're using the CF8 Beta and it hasn't expired, you can export your settings, including datasources, and then import them back in when you get the Dev Edition loaded. This could save you a ton of time if you have lots of custom settings in your CF Administrator like Mappings, Datasources, etc.

Open the CF Administrator and on the left menu toward the bottom, there's an option called: Packaging and Deployment. Click on ColdFusion Archives. Enter a archive name, which is a filename with a .car on it - click Create.

NOTE: If you are using Firefox it will block the popup necessary to complete the process. Click the Options button in the upper right corner and select Allow Popups for 127.0.0.1. Then repeat this process again, until you can see the popup window.

In the popup window you have a choice. Either click Select All, and all settings will be written to the file. Or if you want to reduce the file size, you can select individual sections. Along the left edge are a bunch of links. Click one and the select the options you want to export. Keep Clicking and configuring until you have everything you want. When you are finished click the Close Window button.

Now it is time to Build the .car file. In the Actions column, next to your .car file, there are three circular button links. The first one Edit the config, Second one builds the .car file, and third one deletes. Click the center button.

A popup window opens showing its settings. Click Next in the bottom right corner. Choose a location to write the file, and then manually type in the name of your .car file. When you click next it will build the file. An alert box will indicate: Build Successful. Click OK. Click Close.

End of .car export process.

Now you can turnoff your Windows Services that ColdFusion is using and uninstall. When you reinstall, most of the settings you'll leave as default, but here are a few exceptions:

  • I use the single server option (not multi-server), but you can choose multi-server if you want.
  • For the Web Server, if you're using Apache, you'll need to click the Add button
    A dialog box pops up asking three questions:
    1. Apache
    2. "C:\Program Files\Apache Software Foundation\Apache2.2\conf"
    3. "C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe"
  • Change the location of the Webroot to
    C:/www
  • Change the location of the ColdFusion 8 Administrator to C:\www\localhost\
  • That's the end of the process for Apache. If you're using IIS, use the settings the installer chooses for you unless you want to custom configure them.
  • Make sure you enable RDS and enter passwords for it
  • If you have trobule finishing the part of the install that runs in the web browser, open a browser manually and enter
  • Installation should have completed without errors. If it reported errors you'll need to stop the ColdFusion Services, Uninstall, Delete "C:\ColdFusion 8" folder, and install it again.

Importing .car File

After installation and the configuration in the browser has finished, open the CF Administrator and import the .car file you downloaded earlier. On the left menu in CF Admin there's an option called: Packaging and Deployment. Browse the server for the .car file, remember the server is on your local notebook now, so the .car file is on your desktop
C:/Documents and Settings/[Your Profile]/Desktop
When you find it, click the Deploy button.
NOTE: If you are using Firefox it will block the popup necessary to complete the deploy. Click the Options button in the upper right corner and select Allow Popups for 127.0.0.1. Then repeat this process again, until you can see the popup window.
You will see a popup window, click Deploy again, and Next, and then Close when the process is completed. When all is well and finished, you can exit the CF Admin. The .car file setup your datasources and mappings.

Installing Eclipse

Eclipse 3.2 is very stable and uses JRE 1.5 which is also called Java 5. Eclipse 3.3 is the latest, however, and uses JRE 1.6 or Java 6. The process for installing either is similar, with subtle differences. I like the latest and greatest, Eclipse 3.3. Download and Install Eclipse 3.3 - eclipse-SDK-3.3-win32.zip file and TortoiseSVN-1.4.4 file to your desktop. Unzip the eclipse file to C:\Eclipse (Winzip will create the folder for you, if you enter the path in the extract window). Once installed, you can browse to C:\Eclipse and make a shortcut to the eclipse.exe file if you want to put it on your desktop or Quick Launch bar.

Install the Tortoise MSI file.

About Eclipse Workspaces

Workspaces, in a nutshell, are entirely separate Eclipse workbenches with an entirely unique set of Preferences, Views, Settings, etc. You can copy those details from Workspace to Workspace if you want, however. So why would you use Workspaces? Well I have a Workspace for each of my clients. One client has five projects, another has only one, while a third one has ten different projects. I like to keep my projects structured and organized, and Workspaces makes that possible. I wouldn't make a unique Workspace for a single site, here and a single site there though.

I recommend creating a Workspaces directory on the C:\ drive and keep all of your Workspaces in that directory.

Configuring Eclipse and Installing Plug-ins

Start Eclipse. You will be asked where to create the workspace. Retype the path in the box to
C:/Workspaces/MyWorkspace
Eclipse will open a new workspace. If you are presented with a graphical welcome page, select Workbench to the far right. Once inside the Workbench, we will proceed to configure it and install plug-ins.

If you require proxy info, then before installing plug-ins enter your proxy settings into Eclipse. In Eclipse find Window>Preferences. In Preferences expand General and select Network Connections. Enter your proxy info.

The process of installing plug-ins has been greatly simplified in the past year. For every plug-in that has a remote site URL, you will follow this process:

Here is a list of the plugins and their URLS that I am using:

CFEclipse: http://www.cfeclipse.org/update [checking the top box selects everything]
Subclipse: http://subclipse.tigris.org/update_1.2.x [Make sure Integrations(Optional) is Unchecked]
QuantumDB: http://quantum.sourceforge.net/update-site [checking the top box select everything]
  1. In the menus along the top find Help>Software Updates>Find and Install.
  2. Select the Radio button next to: Search for new features to install and click Next.
  3. Click the New Remote Site button.
  4. In the box that pops up, enter any name you'd like to describe the plugin, and then enter the plugins URL. Click OK.
  5. Wait for Eclipse to contact the download sites and get the latest plugin info. Eclipse will add the plug-in you manually add to the list that already exists too.
  6. Now you check the boxes of the plugins you wish to install, but be careful. Checking the Parent checkbox selects all child checkboxes, and sometimes you don't want all of the children.
  7. As mentioned before, there are already some plugins listed in the Software Updates window. You should click the + next to Europa Discovery Site.
    • Under Java Development, click the check box for J2EE Standard Tools.
    • Under Web and JEE Development, click the checkbox for Web Standards Tools (WST).
    Once those plugins are checked you might see an error message in the top of the window. This is telling you that other plugins are required to run the plugins you selected. Simply click the button on the right side that says Select Required. That will select everything else that is required to run the plugins you selected.
  8. Install the ColdFusion 8 Extentions, which contain the line-by-line debugger and RDS functionality. Inside the Software Updates window click New Archived Site, enter any name that you'd like and then browse to the .zip file your downloaded. Click OK. Check the Box for it.
  9. You should have everything you want to install checked. Now click Finish.
Eclipse will download and then install everything you have checked. It will ask you which Mirror you want to download from. You can select the Select Mirrors automatically if you want. Eclipse will ask you for check a radio button to accept the User Agreement and then display and Install and Install All button. Click Install All so it installs everything. This process will take some time to run, because it is downloading and installing quite a bit.

When it finishes it will ask if you want to re-start Eclipse - Select Yes.

That is it, everything is installed and configured for local development. See the Related Entry, How To Configure Eclipse to Work with Subversion Using Subclipse to get started with Subversion.

Comments
Copyright ©2007 JimPickering.com. Some rights reserved. BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.