CF Builder tip: add vhosts to servers in bulk!

Our main project at work is a work in progress... it's old, and it uses subdomains to trigger changes in the way the codebase is handled. What that means to builder is having one instance of CF powering a great many vhosts. Now, I dunno about you, but I REALLY hate adding vhosts to Builder using the panel in the Server properties. But, I'm here to tell you, there's an easier way!

Before you do this, please backup your workspace folder. /silly disclaimer

If you go into the folder {workspace}/.metadata/.plugins/com.adobe.ide.coldfusion.server you'll find a file called Server.xml. The first issue you'll have is that the XML is entirely unformatted. If you're not using an XML editor that supports automatic formatting, try using a text editor that supports regex find/replace and replacing "><" with ">\r\n<" on Windows or ">\r<" on OS X.

If you open that file up, you'll see your configured servers. Each server contains quite a number of properties, more than I can really deal with right now. But, if you have already configured one vhost, you should see a subtag of called . That should have your vhost block sitting there smiling at you, waiting for you to duplicate it. The contents look something like this:

view plain print about
2    <VirtualHost>
3        <Name>My Nifty Virtual Hosts</Name>
4        <Address></Address>
5        <Port>80</Port>
6        <Location>C:\inetpub\www\wibble</Location>
7        <EnableSSL>false</EnableSSL>
8    </VirtualHost>

You can now duplicate this section and fill your own values in for the properties.

There is one very crucial gotcha!

CF Builder does a couple interesting things that could really mess you up if you're not aware of them. First, all configs are read when the app starts up, so you need to have these changes in place and THEN open Builder. Also, when you exit the program, it flushes all the settings to disk, so if you edit the Server.xml file with Builder, save it, and then exit the program, you've just lost all your changes. So you need to either shut Builder down and use a different editor to make the changes, or you need to edit the file, do a Save As... outside the workspace folder, then copy it over the one that's there by hand.

Once you've got the changes saved to disk and the edited file in {workspace}/.metadata/.plugins/com.adobe.ide.coldfusion.server, you can start up Builder, double-click the server in the Servers tab and take a peek at the Virtual Hosts section of the second page. You should see that you've just saved yourself a great deal of effort by editing the config file directly rather than using the futsy-putsy UI.

Either way, I just added 11 vhosts to my server config using copy/paste/change instead of 45 minutes of tabbing, clicking and complaining.


SQL Server 2008 Installation/Uninstallation Torture

So yesterday I needed to install SQL Server 2008 on the Lenovo issued to me by my employer. No big deal, right? I have the developer version DVD, so I stuck it in the drive, decided to install everything, and away I went. Or not.

For some as-yet unexplained reason I kept getting an error, which, apparently, isn't at all uncommon for people trying to install SQL Server 2008. The error reads something like this:

    An arithmetic error resulted in an overflow.

Before we continue, let me set the stage a bit. There are several factors involved that should be called out clearly before proceeding:



This is the first post in the New

Gone is the old stuff... here's the new. Yay! Let there be rejoicing and dancing in the streets! I have a bunch more setup and configuration and stuff to do, but I'll be getting everything set up right before you know it.

I'm back. Feels good. ;)


BlogCFC was created by Raymond Camden. This blog is running version 5.9.7. Contact Blog Owner