Posted on June 22, 2008 at 1:39 AM in General, ColdFusion
Okay, I admit it. I'm a WinDoze guy. I even have the property patch. Well, kinda. When it comes to me being the server administrator, it has to be WinDoze. Sorry boys and girls, but I don't come from a network background, or even a programming background, so I like point-and-click. I'm comfy in that realm. Start talking shells and all of those other "big words" that pertain to *nix, and I'm lost. That said, I am looking to justify the expense for my first MacBook Pro and/or iMac - but we'll save that for another time and post.
Last night I suddenly realized that I *really* needed to either (a) upgrade my development machine to WinDoze Server, (b) purchase some sort of add-on software, or (c) load Apache. Since Apache is free, I opted for (c). Here is a (somewhat) quickie overview of why I needed to make a move, a couple of links that I followed to get it done, and a couple of "gotcha" notes.
Why the move?
Actually, there are two reasons. The first is that for the first time in my development career, I am working in a team environment. As such, I really feel the need to try and have as close to the same environment that my fellow team members have. The second reason is Transfer.
"What on earth does Transfer have to do with it?"
As I'm sure most (if not all) of you know, when running IIS on WinDoze XP Pro, you can only run one "website". So each project is browsed to under the server root:
This can be an annoying thing, but since it's what I have used for many, many years now, I learned a really long time ago how to setup my applications to move (unchanged) from this environment to a production environment where each application has its own "website". And this is where Transfer enters into the equation...
- <object name="MyObject"
- <!-- definitions -->
If running IIS on WinDoze XP, this poses a problem unless your project is in the web root, and unless you only have one project that you're working on, that simply isn't the case. The only options available are to either (a) use a different Transfer config file for production and development, or (b) have a development environment that mimmicks the production one. If you're like me, Option A is really not a viable option.
The Apache Installation
My apologies if you're looking for a step-by-step tutorial on installing Apache on WinDoze XP, because this isn't one. However, I will gladly share with you the guides that I followed in getting my machine up and running.
Between those two guides, I was able to get Apache installed and hooked up to my ColdFusion install. Then it came time for the Apache equivalent to WinDoze Virtual Directories, known as Virtual Hosts.
This is the point where I about came uncorked, and started slinging 4-letter words around like a drunken sailor. However, thanks to Jared Rypka-Hauer's willingness to share his knowledge and expertise with me, and his surprising patience in dealing with my frustration (hey, what can I say, I wasn't very much fun to deal with at the time), this too became an obstacle that was left by the wayside.
Here are the three main secrets to Apache's Virtual Hosts...
1. Find the following two lines in the httpd.conf file (in my install it is located at C:Program FilesApache Software FoundationApache2.2conf)
- # Virtual hosts
- #Include conf/extra/httpd-vhosts.conf
... and change it to
- # Virtual hosts
- Include conf/extra/httpd-vhosts.conf
What you've just done is uncommented the Include line, which loads the httpd-vhosts.conf file.
2. Add a VirtualHost block for each project. This is done in the httpd-vhosts.conf file that we set to include in Step 1. On my install, it is located in the C:Program FilesApache Software FoundationApache2.2confextra directory.
- <VirtualHost *:80>
- ServerAdmin email@example.com
- ServerName projectname
- DirectoryIndex index.cfm index.html
- Options Indexes MultiViews Includes
3. Be sure to allow permissions for the project directory.
- <Directory "D:fullpath
- Order allow,deny
- Allow from all
This all-important step is (to the best of my knowledge) typically required because by default, Apache locks down *everything*. So you have to "unlock" the project directory.
More info: Name -based Virtual Host Guide (Apache docs)
Additional Setup Notes
If you happen to have a setup where you have a centrally-located set of scripts, images, CSS files, or some other non-ColdFusion files, you'll need to create an Apache "mapping" (alias) to them. Find the <IfModule alias_module> block in the httpd.conf file, and add the appropriate Alias(es) as shown in the examples.
That's about it, folks. I now have Apache running on WinDoze XP Pro, hooked into CF 7.02 (JRun config). Hopefully by documenting my pain and frustration here you'll be able to avoid most (if not all) of the same pitfalls.
Major "THANK YOU!" once again to Jared Rypka-Hauer for putting up with me and helping calm me down and get things working.
Oh yeah, before I forget, I have to give an Honorable Mention Award to Mark Mandel for the following:
basically you want Transfer to solve the problem that you're too lazy to setup a decent development env ;) ?
That comment is what made me suck it up and try to install Apache in the first place. (I had asked about dynamic values in the Transfer config file.)
- ColdBox (21) [RSS]
- ColdFusion (92) [RSS]
- Fusebox (3) [RSS]
- General (22) [RSS]
- jQuery (15) [RSS]
- Kalendar (1) [RSS]
- Linux (1) [RSS]
- Mura CMS (1) [RSS]
- Railo (1) [RSS]
- Rants (5) [RSS]
- Transfer (8) [RSS]
- Uni-Form Tag Library (36) [RSS]