The World's Favorite Open Source GPL J2EE CFML Runtime Engine

BlueDragon Developer's Journal

Subscribe to BlueDragon Developer's Journal: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get BlueDragon Developer's Journal: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Open BlueDragon Authors: Reuven Cohen, Elizabeth White, Michael Sheehan, John Gauntt, Salvatore Genovese

Related Topics: Open BlueDragon Developer's Journal, ColdFusion on Ulitzer, Java EE Journal, Apache Web Server Journal, MySQL Journal

BlueDragon: Article

LAMBDA Boxes: Linux and BlueDragon for Low-Cost CFML Happiness

In recent months, the term 'LAMBDA Box' has taken hold in the CFML community

In recent months, the term "LAMBDA Box" has taken hold in the CFML community. The idea of a low-cost CFML server based on Linux, Apache, MySQL, and BlueDragon provided a solution for me in early 2003, and resulted in the invention of the term.

Let's take a look back at how that box came into existence, and what I've learned about Linux and CFML.

The Problem

In early 2003, I was looking for a way to provide a workgroup server to run internal program management applications for my team of CFML developers. The project in question provides development services for a nationally scoped application written for a federal government agency. Details of the application and agency don't matter, other than the fact that the project works essentially as a mini-IT department, taking requests for application changes and incorporating them into an ongoing development pipeline.

As the program manager, I had created a set of small applications to assist me in managing the project, in particular the pipeline of requests coming from our customer. These applications were written in CFML, and required a lightweight database to support them (at least at the outset). Wanting to prove the concept of these programs, I set out to find a low-cost solution for a reasonably high-reliability server on which to house them. As with most proofs-of-concept, our budget for new hardware and software was very limited.

Going for low cost, I knew that Windows and ColdFusion were probably out of the question. Not only would I need to purchase a new computer to be the server, but I would need to buy the application server software. Windows and ColdFusion were out of the price range for my little concept project.

Naturally, I turned next to Linux as the operating system. Linux's reputation for high reliability was very promising, and the very low cost of a Linux installation was attractive from a price perspective as well. But Linux wasn't an instant winner, either.

Since I would not be only person needing to deal with the server in question, but was one of the only Linux aficionados at the company, I needed a distribution that provided a comfortable front-end experience. Unlike many Linux servers that run only from the command line, my server would need to have some GUI capability, and a certain degree of user-friendliness. Linux distributions like Mandrake, SUSE LINUX, and Linspire came to the forefront as having strong desktop presentations as well as the underlying power of Linux. I would have to decide which would do the job.

The final hurdle in keeping costs down was finding a low-cost computer to run the whole configuration. If there had been a spare computer available, we would have used it, regardless of processor speed. This was truly a lowball proof. The idea was to build a more expensive machine if the proof box worked.

To summarize, the problems I needed to solve were:

  • Need for a low-cost, high reliability operating system
  • Unfamiliarity of users with OSes other than Windows
  • No budget for expensive application server software
  • No budget for expensive database software
  • Limited budget for hardware

The Solutions

At the time, the Lindows (now Linspire) distribution of Linux had been on the market for a couple of years, and had been progressing nicely as a desktop distribution. Having looked at Mandrake, SUSE LINUX, and Lindows, I wasn't drawn strongly to one over the others. Each used the KDE desktop environment, and seemed to have fairly reasonable installation tools. Since I could download distributions, I figured I might try each distribution and then decide which one to keep. Whichever distribution I chose, I knew I would use Apache as the web server software. So, with the Linux decision back-burnered, I moved on to the CFML server.

Fortunately, New Atlanta was in beta testing for the 6.1 release of their BlueDragon CFML application server. The free version of their software (known as BlueDragon Server) allows production instances in a workgroup environment at no cost. The compatibility notes for Linux stated that BlueDragon would work with a Debian distribution of Linux, so I didn't expect too much trouble in getting it to work.

Similarly, I chose MySQL as the database software for the project. MySQL is a solid, low-cost solution for reasonably sophisticated database problems. In fact, for my needs, it was a bit of overkill, but I was safe in the knowledge that it could grow with the applications if necessary.

Finally there was the hardware issue. Even in the age of personal computer price dives, I wasn't looking forward to trying to find a decent box on our extremely limited budget. Linux gave us a bit of leeway, in that we didn't need the same kind of processor horsepower or memory that we would have needed for decent performance out of a Windows-based platform.

I am usually very leery of introductory promotions from any company, as I don't care much for being a guinea pig. But with little to lose and much to gain, I chose to risk purchase of an extreme-low-end "white box" from a company called KooBox. The reasons were several. In conjunction with Lindows.com, KooBox offered an AMD-based box with 256MB of RAM, a 40GB hard drive, Lindows preinstalled, and a 17-inch flat panel monitor for $500.00. With that small amount of money invested, I figured the damage wouldn't be too bad if the box turned out to be a lemon. After all, it was simply a "proof of concept" demo. If we proved we'd need to spend more money, that would at least be a valid result.

When the machine arrived, I set it up and configured it to run on our corporate intranet. This took about 15 minutes from the time I opened the boxes to the time I got a successful network connection. The excitement of a new experiment began to increase.

The next step was to download the Apache web server. Linspire includes a software management utility called Click-N-Run (CNR) which installs applications with a single click. Unfortunately, Apache was not available through CNR at the time. So I downloaded Apache 1.3 and installed it "the old fashioned way" (following the README file) in its default location (/usr/local/apache). With Apache started, I tested to see that I could get to HTML pages served on the machine.

Satisfied that everything worked so far, I downloaded BlueDragon 6.1 beta 1. I ran the installation to install to /usr/local/NewAtlanta, and checked the httpd.conf file to see that the BlueDragon configuration lines were there. A restart of BlueDragon (/usr/local/NewAtlanta/BlueDragon_61/bin/StartBlueDragon) and a restart of Apache (/usr/local/apache/bin/apachectl stop; /usr/local/apache/bin/apachectl start) later, I requested the BlueDragon test page (http://127.0.0.1/BlueDragon) and got the expected response, shown in Figure 1.

I then downloaded MySQL and MySQL Control Center and installed them, this time using the CNR client. After a few hiccups with user configuration (before I read the installation manual and actually paid attention), I confirmed a successful installation by using the MySQL Control Center application. I then set up the database tables I needed for my application.

So far, so good. I went to the BlueDragon Administrator page and set up a MySQL datasource, referencing my new database. BlueDragon threw an ugly error suggesting I upgrade my client software. I recalled Charlie Arehart mentioning something about MySQL drivers on the BlueDragon interest list. I went to the list and found the message in question. Due to a licensing issue, NewAtlanta couldn't distribute the latest MySQL driver with BlueDragon. I downloaded the driver from MySQL and installed it, then went back to BlueDragon Administrator to set up the datasource again. This time it worked as expected.

With all the desired software installed and running, I realized I had created a CFML-based version of what the PHP folks call a LAMP box: Linux, Apache, MySQL, PHP. So I christened the concept LAMBDA. That is: Linux, Apache, MySQL, BlueDragon Application server.

The final step was to set up the various processes (Apache, MySQL, and BlueDragon) to autostart on bootup, and the configuration was complete. I was ready to implement my suite of management applications, and put the whole thing in front of my client.

Reliability

Reliability was one of the questions in the forefront on this test, particularly with using such a bargain-basement computer. I only wish every piece of cheap hardware worked out so well. Running the server proved to be quite easy, though after it had been up for several days we would get a "ServletExec not found" error when trying to access the pipeline management application. A restart of the machine solved the problem until the next randomly-timed occurrence. While a bit annoying, this really wasn't a show-stopper, as it usually manifested first thing in the morning so a restart wasn't a big deal. This wasn't a publicly available server, so uptime wasn't critical either. When Lindows released their 4.5 version, I reinstalled the server on the new OS with the by-then-production version of BlueDragon 6.1 and Apache 1.3.28 and the problem hasn't recurred.

As of this writing (December 2004), the pipeline server has been up for several months without complaint. It provides my development team and my customer with a resource to follow "who's doing what" with respect to development requests. Instead of being the test that would allow us to buy something more expensive, the proof-of-concept box has turned into a regular part of our daily existence, and continues to chug along, doing its assigned job. Figure 2 is a photo of the legendary beast itself.

Configuration Details

Though I can't provide all the details of configuration changes throughout the installation, testing, and upgrade of the original LAMBDA box, this section provides details of the current configuration, in case you want to build your own.

Apache 1.3.28
Apache is installed in /usr/local/apache. The httpd.conf file has the lines shown in Listing 1 to activate BlueDragon.

A startup item linked to the apachectl program ensures that Apache starts up if the system is restarted.

If you choose to use Linspire (as Lindows is now known, following legal action by Microsoft), you can now install Apache via CNR. If you go that route, the installation is a bit different, as the webroot is installed at /var/www and the configuration files are in /etc/apache.

MySQL 4.0.15
MySQL is installed in /usr/local/mysql-standard-4.0.15-pc-linux-i686. Utilities such as MySQL Control Center (mysqlcc) or Aqua Data Studio (www.aquafold.com) provide interfaces to the database. When configuring MySQL, pay careful attention to the User Configuration section of the User's Guide. MySQL has default users when the system is set up. You can define your own users after logging in as the default user "root". Note: If you use CNR to install MySQL, you'll get whichever version is most current on CNR, as opposed to the 4.0.15 described here.

BlueDragon Server 6.1
BlueDragon is installed in /usr/local/NewAtlanta/BlueDragon_Server_61. No modifications to BD were required following installation, beyond the usual datasource setup. A startup item linked to the StartBlueDragon.sh script ensures that BD starts up if the system is restarted.

I have done subsequent LAMBDA installations on Linspire boxes where the BD installer didn't notice that Apache was installed, and so didn't make it available as an installation option. If this happens, you can use the webserver configuration utility in the BlueDragon Administrator to configure Apache for BlueDragon.

Security
Followers of Linux may be aware that the Linspire distribution uses the root user as its default account. While this presents a security risk in the overall scope of Linux system administration, it's not a show-stopper in the context of a small workgroup server like the subject of this article. With implementation of a software firewall on the server (included in the Linspire distribution), we have seen no intrusion on the server throughout its service life so far.

That said, I strongly recommend use of tighter security measures for a server that is intended for the public Internet user community. Other proponents of the LAMBDA concept, notably David Epler (www.dcepler.net), have pursued using RedHat as the Linux distribution, and configuring all processes to run under non-root accounts. This takes a bit of effort to do correctly, but is well worth it if the server is going to be exposed to the public.

There, I have issued the requisite warnings.

LAMBDA Now

Since the creation of that first LAMBDA box, I've seen the interest in CFML on Linux grow at an increasing pace. The Fusebox 2004 conference included sessions specifically directed to the issues involved in running Fusebox applications under BlueDragon on a Linux box. David Epler's site, mentioned above, has some very good information on tips and tricks in these areas.

My personal interest in LAMBDA is as a low-cost developer's solution for people who are interested in the world of Linux, but haven't yet ventured forth. The maturity level of Linux as a desktop solution has reached the point where someone who has never worked in a UNIX-like environment can still use a Linux machine immediately and successfully. While you can still resort to the power of the console and command line interface if you wish, there is now a very deep wealth of GUI-based tools for Linux. These tools make it simple to do everything from typical file management to email and general office work.

Moreover, Linux offers the ability to resurrect hardware that had been relegated to the closet. I have done much of my recent LAMBDA experimentation on an old Pentium II laptop that had become a doorstop as Windows upgrades left its 233MHz processor and 80MB of RAM gasping to keep up. With Linux installed, the same machine works quite well. Yes, there are some programs that take a few more seconds to load, but overall it's still a very serviceable machine. It's very nice to have a portable machine dedicated to tinkering with LAMBDA, without having to deal with the quirks of a dual-boot system.

Summary

The low-cost end of the workgroup application server market is often overlooked. There is a great deal of power to be leveraged within a CFML-based organization through the use of Linux, Apache, MySQL, BlueDragon application (LAMBDA) servers at the workgroup level. Expertise gained in writing in-house applications translates well when preparing to build larger scale applications intended for BlueDragon JX, BlueDragon J2EE, BlueDragon .NET, or CFMX platforms.

If you are interested in building your own LAMBDA playground, I have a class coming up called "Build Your Own LAMBDA Playground." During the two-day course, attendees will install and configure LAMBDA boxes, and get an intro to CFML applications using Fusebox. The best part is you get to keep the brand new laptop you set up during the course as part of your course materials! Details are at www.protonarts.com.

More Stories By Jeff Peters

Jeff Peters works for Open Source Data Integration Software company XAware.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.