Taming the MySQL Date_Format Function
This is just a quick post of a little problem I've been running into lately. I'm not sure if it's a bug or some kind of intended MySQL thing, but it's annoying as heck. Also, I'm using MySQL version 5.0.32. I'm not sure if this applies to older versions of MySQL or not, but it seems to be something new with the 5.0 variants.
A Step-By-Step Guide To Install Railo Server 3.1 On Mac OS X 10.5 (Leopard)
When I was ready to install Railo server I hit up google to see how you would go about installing it on Mac OS X 10.5 (Leopard). There wasn't a lot out there. Actually, there was only one good article I could find, but it didn't allow me to do everything. I've decided to post the steps I took to install Railo Server on my Apple G4 running Mac OS 10.5 Leopard. But first, I have to give credit where credit is due. I based this entire article on what I found here at Luis F. Majano's blog. Everything is built upon this post. Thanks Luis!
My Goal
The goal of this install is to get Railo running on my server and to have all web files located in a common folder and accessible from the outside internet. I need to do this, so my clients can check their site as I am developing them. I have not tried installing PHP or Adobe ColdFusion server along side Railo. This is something I may look into down the road.
My Setup
- Here's a quick list of my setup:
- Apple G4 Server running Mac OS X 10.5.8
- Railo 3.1.1 w/Resin for Apache (www.getrailo.org/index.cfm/download/)
- MySQL 5.1.38 (This is not really important for this tutorial, just listing what I'm using)
Pre-requisites
You are going to need to have a text-editor of some sort, I use BBEdit. It allows me to edit hidden/protected files, by providing my Admin password. I'm going to assume that you can figure out how to edit these files if you plan on using something else. You are going to need to use the Terminal.app (don't be scared, I'm by no means a Terminal master). And finally, you are going to need to have XCode installed on your development machine in order to make the install the Railo Apache connector. And lastly, you need to be logged in as an Administrator. I don't think this will work, if you cannot do this.
This may seem obvious to some, but just in case, you also need to have Apache running. To do this, you need to open up System Preferences > Sharing. Make sure that Web Sharing is checked. You can test if Apache is working by pointing your web browser to your server (localhost or 127.0.0.1 if it's on the machine locally) and see if you get the default Apache welcome screen. If it is, your ready to roll. If it's not, then you need to get that working before you can continue.
Transitioning From Adobe ColdFusion To Railo On Mac OS X 10.5 (Leopard)
I've been developing ColdFusion sites for a good 10 years. I remember the Allaire days, eased through the Macromedia days and suffered through the Adobe days. ColdFusion 4.0 was my first taste of the CFML language. I'm not sure if it was it short learning curve or it's ability to allow me to create websites so quickly, but either way I fell for it instantly.
I'll be the first one to tell you that ColdFusion always had room for improvement. My complaints were fairly simple, from wanting server side image manipulation without using a plug-ins, to making it less of a resource hog. The biggest complaint I have nowadays, is the fact that Adobe seems to be focusing ColdFusions attention to Flash and Flex. Two technologies, which I will admit, could care less about.
I'm sure some of you would argue with me, but I think the days of developing Flash sites are numbered. With HTML 5 on the horizon, there's really no need to bother with this buggy, resource hogging, technology. It saddens me that Adobe (or more to the point, Adobe's sales department) is pushing this technology so hard. I wish they would focus more on the core language and features, but alas they don't seem to be going that direction.
Then this week something happened. My ancient Apple G4 development server which was running Adobe ColdFusion 8 crashed. I decided to do a clean install of everything and at the same time upgrade the operating system from Mac OS X 10.4 Tiger to Mac OS X 10.5 Leopard. I really wanted to take advantage of Apple's Time Machine to do my back-ups, which unfortunately is only available for Leopard users. The upgrade was going smoothly up to the point where I installed ColdFusion server. Oops! Apparently ColdFusion doesn't play well with Leopard. IT has something to do with the Apache contector or something. Honestly I just didn't care anymore.
First let me say that I understand that no hosting company is going to be perfect. I understand that they have to deal with issues every single day and sometimes an issue may not get resolved immediately. And now that I have gotten that off my chest, let me tell you of my experience with a hosting company called HostMySite.com.
It all started last year when I finally had it with CrystalTech. CrystalTech's tech support at the time was horrendous. I could no longer deal with the constant site crashes and abysmal support responses. So after a few weeks of scouring the web, I made the decision to move a couple of clients to HostMySite. On average, people were giving them praise and said that their tech support was superb. They were a little more expensive, but I made the assumption that this was the price I had to pay to receive better service. I had my clients buy their top shared hosting ColdFusion 8 plans.
Almost immediately after moving the site over to their server, we began to notice problems. HostMySite uses a ColdFusion server management application called "SeeFusion". I'm not 100% familiar with this program, but from what I can gather it keeps the different sites in check by making sure that they don't overload the server, kill request that take to long and handle server restarts. The error message we started to see was simply called the "java.lang.ThreadDeath" error.
ColdFusion Components and Var Scoping Trick
Var scoping is essential when dealing with ColdFusion Components. You can get weird results or even some hard-to-track errors if you don't do this. I'm not privy as to why this happens, I just know that it does. It's one of those mysteries that I just never bothered to research. All I know, is that sometimes it's a pain in the butt, especially when your writing a fairly complex function and you forgot to var scope an "i" in a cfloop or some other quick and dirty variable you made.
Well a few months back, I started doing something with my function variables, that I thought I would share. Not only does it solve my var problem, but it winds up making the top of my function shorter (I'm a stickler for cleanish looking code). Essentially I create a generic local struct in the begining and I'm sure to var scope it, like so:
<cfset var local = StructNew() />