BlueDragon 7b1 on Ubuntu 6.10

Soon after getting a couple of my Linux boxes moved to the then newly-released Ubuntu 6.10, I started down the path of getting a couple of CFML engines installed and running so that I can use them as development boxes. Having been able to configure these boxes with BlueDragon in the past, I didn’t really anticipate any problems. It appears, however, that there is some sort of library incompatibility problem between the installer for BlueDragon 7 beta 1 that causes the installer to throw errors like these when run:

$ sudo ./BlueDragon_Server_70_321- Linux.sh
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
nawk: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
Launching installer...
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/tmp/install.dir.12991/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

Ugly, eh?

Earlier this week, I received a response from Gregg Orangio on the New Atlanta BlueDragon interest mailing list with a workaround for the installer issue. Here, then, are the steps I worked through to get BD7b1 (latest as of this date) working on Ubuntu 6.10. I wanted a couple of things to be set up differently this time from previous installations in the past, and they are factored into this series of steps:

  • I planned to have BD use its built-in server, rather than configuring it to talk to Apache, for a couple of reasons: this is only a beta, and I also plan on having the “other” main CFML engine installed on the same box and I haven’t yet really decided which will end up being my primary engine yet for these boxes. Having been able to get BD to talk to Apache without any problems in the past, I figure I can always backtrack and start over with an Apache-based configuration when/if I make that decision.
  • I want to be able to develop CFML pages in my local account’s directory structure.

Here, then, are the steps I followed…

Installing the Server

Start by making sure that you have the “daemon” package (we will use this as part of the automated startup and shutdown of BD in conjunction with starting up and shutting down the system itself) and the “libstdc++2.10-glibc2.2” package (BD needs this for CFX custom tags, if you care) installed on your system.

Create the folder in which you wish to install BD:

$ sudo mkdir /opt/bd

Download the BD7b1 installer from the New Atlanta site, and then patch it to get past the above-mentioned library incompatibility. After that you can run the installer:

$ cd ~/Downloads
$ cat BlueDragon_Server_70_321-Linux.sh |
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > BDS_70_321-Linux.sh
$ chmod +x BDS_70_321-Linux.sh
$ sudo ./BDS_70_321-Linux.sh

Work through the installer, telling it where you want BD installed (I chose /opt/bd), the port (I retained the default), and which Web server to use (I chose “None at this time” so that it would just use its built-in server). If your experience is like mine, the installer will do its stuff and exit. When it finishes, you should manually start the BD server and make sure it works:

$ sudo /opt/bd/bin/StartBlueDragon.sh

Point your Web browser at http://localhost:8080/ and you should see the installed test page rendered correctly. For now, go ahead and stop the server so that you can finish the installation process:

$ sudo /opt/bd/bin/StopBlueDragon.sh

Configuring BD to Run as a non-root User

$ sudo groupadd bluedragon
$ sudo useradd -d '/opt/bd' -c 'BlueDragon CFML Server' -s /bin/sh -g bluedragon bluedragon
$ sudo passwd -l bluedragon
$ sudo chown -R bluedragon.bluedragon /opt/bd

Configuring BD to Start/Stop with the System

The BD installer creates a start/stop script that can easily be incorporated into the system’s startup and shutdown sequences, but since we want BD to run as a non-root user, we need to tweak that script a bit. The installer puts its script in /etc/rc,d/init.d/BlueDragon_Server. Edit that file with vi or your favorite editor, so that it looks like this:

#!/bin/sh
# Startup script for the BlueDragon Server
#. /etc/rc.d/init.d/functions
bdstart=" /opt/bd/bin/StartBlueDragon.sh "
bdstop=/opt/bd/bin/StopBlueDragon.sh
prog="BlueDragon CFML Server"
bduser=bluedragon
start() {     echo -n "Starting $prog: "; daemon -u $bduser $bdstart ;    echo ; RETVAL=$? ; return $RETVAL ; }
stop() {     echo -n "Stopping $prog: "; daemon -u $bduser $bdstop  ;    echo ; RETVAL=$? ; return $RETVAL ; }
case "$1" in
start) start& ;;
stop)  stop  ;;
restart)    stop; start    ;;
*) echo $"Usage: $prog {start|stop|restart}"
exit 1
esac

The key changes are the commenting out of the invocation of /etc/rc.d/init.d/functions (since it doesn’t exist on Ubuntu systems), the definition of a variable called “bduser” which references the new non-root user account we set up earlier, and the use of “daemon” along with that new user account on the start and stop steps.

Set up the links within the system’s startup/shutdown framework to point to this new script:

$ cd /etc/rc2.d
$ sudo ln -s /etc/rc.d/init.d/BlueDragon_Server S92BlueDragon
$ sudo ln -s /etc/rc.d/init.d/BlueDragon_Server K92BlueDragon

Restart your system, and again point your Web browser at either the test page or at the BD admin interface to make sure that the BD server is now running by default.

A Local Development Web Folder

At least on the surface, there doesn’t appear to be a means by which I can have the BD built-in Web server point at a shared Web folder and allow for local user accounts to also have their own development folder (e.g., the typical ~/public_html/ folder supported by Apache). I worked around this by just setting up a symbolic link within the BD Web root with the appropriate name:

$ cd /opt/bd/wwwroot
$ sudo ln -s /home/ron/public_html '~ron'

Test to make sure it is set up correctly by creating a simple CFML test page in that local folder and then pointing your Web browser at http://localhost:8080/~ron/test.cfml to make sure it is going to work.

Configuring BD to Work with MySQL

Download the latest MySQL Connector/J packages in the 3.1 series from the MySQL site. Extract the .jar file (it will be named mysql-connector-java-3.x.x-bin.jar) and place it in the ./lib/ directory within the BlueDragon installation path as “mysql.jar”:

$ sudo cp -v mysql-connector-java-3.1.14-bin.jar /opt/bd6/lib/mysql.jar

MySQL should now show up as an option for datasource types in the list on the BD Admin page for configuring datasources, but you will probably need to cycle the BD server to be able to use a MySQL datasource. A couple of additional items here for consideration:

  • I have done a little bit of cursory testing and the 5.0.4 version the MySQL Connector/J seems to work fine against BD7b1.
  • Vince Bonfanti indicated, on the BD interest mailing list in late September, that they had done all of their testing against 3.1.12, and that they were hoping to use the 5.0.x series in their testing of the second beta.

A Couple of Closing Comments

Obviously, your mileage may vary from mine, but the above series of steps has worked on all of my development boxes. I also can’t say enough about the help I received from the New Atlanta folks that are very active on the BlueDragon interest mailing list, as well as the other members of that list in their timely and insightful responses to requests for help and answers to questions.

And finally, ping me on that list if you have comments or questions on any of this. I would be glad to offer any help I can.