Hop: First steps with Debian 8 “Jessie”

I’ve always felt like I should be running Debian Linux (for obvious — if you know me — reasons) but never have… until yesterday: I have my Asus netbook now running the newly-released Debian 8 “Jessie” release. So far, about all I have done is install, make sure everything is working, and do a bit of typical performance tuning (I/O scheduler, /etc/fstab options, swappiness) to take advantage of the SSD.

More to come…

Setting up a HyperSQL Database Server

I’m in the process of rebuilding one of my development boxes at the moment, and when I needed a SQL database engine this weekend to support a bit of quick prototyping, I decided I would take a shot at setting up a HyperSQL database server. This is something I’ve been meaning to look into for other reasons for a while: HyperSQL is small, fast, flexible, provides good SQL coverage (more complete, for instance than Apache Derby), and has the ability to tune its behavior to more closely mirror other SQL engines.

Here is a quick recipe for getting a basic server up and running. This should work equally well on both Mac OS X and Linux (I have used this basic recipe on both platforms).

My system already has a Java 7 JRE/JDK installed with the java command available in the shell’s PATH, which is really the only prerequisite. For the sake of simplicity, I install HyperSQL in /opt/hsqldb and I keep my database-related files in ~/hsqldb-catalogs/. Commands entered at the shell prompt are shown below starting with $, while commands entered in the HyperSQL CLI are shown below starting with >. Note that some of these commands may appear wrapped below; they should each be entered on a single line when used.

  1. Download the latest version of HyperSQL (version 2.3.1, as of this writing) from hsqldb.org.
  2. Unzip the downloaded file (assumed to be in ~/Downloads/):
    $ cd ~/Downloads
    $ unzip hsqldb-2.3.1.zip
    $ sudo mv ./hsqldb-2.3.1/hsqldb /opt
    $ rmdir hsqldb-2.3.1
  3. Create the folder where the server will store its database files:
    $ mkdir ~/hsqldb-catalogs
  4. Create the properties file that provides basic information for the server, including our test database. Save this file as ~/hsqldb-catalogs/server.properties:
    # File: server.properties
    # =====
    # HSQLDB configuration file
    # Databases:
    server.database.0=file:test/test
    server.dbname.0=testdb
    # =====
    # Other configuration:
    # Port
    server.port=9001
    # Show stuff on the console (change this to true for production):
    server.silent=false
    # Don't show JDBC trace messages on the console:
    server.trace=false
    server.no_system_exit=false
    # Do not allow remote connections to create a database:
    server.remote_open=false
    # =====
  5. Create the configuration file for the CLI HyperSQL tool, describing two different connections to our test database: one as the default system administrative user “SA” and one as a normal administrative user “RON” which we will create in a few minutes. Save this tool as ~/sqltool.rc:
    # File: ~/sqltool.rc
    # =====
    # Connect to testdb on localhost as SA (no password initially):
    urlid localhost-sa
    url jdbc:hsqldb:hsql://localhost/testdb
    username SA
    password
    # Connect to testdb on localhost as RON:
    urlid localhost-ron
    url jdbc:hsqldb:hsql://localhost/testdb
    username RON
    password strong-random-password
    # =====
  6. Start the server. This will create our test database using the following commands in a terminal window:
    $ cd ~/hsqldb-catalogs
    $ sudo java -cp /opt/hsqldb/lib/hsqldb.jar org.hsqldb.server.Server --props ./server.properties
  7. Open a second terminal window and start the HyperSQL CLI “sqltool”, connecting to our test database as user “SA”:
    $ java -jar /opt/hsqldb/lib/sqltool.jar localhost-sa
  8. As a general rule, I don’t like signing in using the system administrator account, so the first thing I typically do is create an administrative user account for my use:
    > create user RON password 'strong-random-password';
    > grant DBA to RON;
    > \q
  9. Make sure you have your “strong-random-password” recorded correctly in ~/sqltool.rc, and restart the HyperSQL CLI:
    $ java -jar /opt/hsqldb/lib/sqltool.jar localhost-ron

You’re done. You have a fully-functional database server, providing a single database called “testdb” for your use.

If you want to play with sample data, consider the following (while connected as either “SA” or your administrative account):
> create schema sampledata authorization DBA;
> set schema sampledata;
> \i /opt/hsqldb/sample/sampledata.sql

When you’re ready to shut down the server, you can do it while connected to the server as a user with DBA role:
> shutdown;

Alternatively, you can shut down the server from the command-line:
$ java -jar /opt/hsqldb/lib/sqltool.jar --sql 'shutdown;' localhost-ron

Some final thoughts:

  1. Read the docs: the user guide and the utilities guide for HyperSQL are good, and provide thorough coverage of what HyperSQL is capable of (which appears to be quite a bit) and how to use it, including connecting via JDBC.
  2. You almost certainly want to set a password for the default “SA” user, and remember to update your ~/sqltool.rc file when you do.
  3. Protect ~/sqltool.rc — obviously this file, with information about catalogs, users, and passwords needs to be protected.

Exploring Tomcat and ColdFusion 10

With the recent availability of a pre-release version of Adobe’s ColdFusion 10 CFML engine, I am going to be doing a bit of comparative exploring to see how this upcoming version lines up against the current 9.01 version. My intent is to install and configure ACF10 on one or more of my development systems in a manner where it can run alongside the currently-installed ACF9 so that I can get a feel, in particular, for any performance differences between these two versions and to ensure that when ACF10 is officially available, any compatibility issues with our CFML-based applications have been addressed.

My current development systems are Mac OS X and Linux boxes, running ACF 9.01 under Apache’s Web server. I will install ACF10 in a stand-alone mode in order to be able to run both servers concurrently. In this mode, ACF10 will be running with the bundled Apache Tomcat server for use as both its application server (replacing the JRun application server historically used with ACF) and as its Web server.

The first portion of this effort, then, will focus on getting ACF10 and Tomcat configured to function as needed in my development environment. With that in mind, I will be exploring the following Tomcat-related configuration needs and blogging about them (as well as anything else of interest I stumble into) in the coming days:

You can see that list is a mix of security-related settings and configuration settings related to how our application folders are structured (and the desire to run these applications through both the new Tomcat/ACF10 stack and the old Apache/JRun/ACF9 stack).

In terms of structure, all of the applications reside in a folder outside of the Apache webroot, and are found via a set of aliases. The folder structure below that top-level folder is set up as follows (with their corresponding application URL’s listed in parens):

  • appGroup1
    • common
    • app1a (http://localhost/app1a/)
    • app1b (http://localhost/appab/)
    • app1c (http://localhost/app1c/)
  • appGroup2
    • common
    • app2a (http://localhost/app2a/)
    • app2b (http://localhost/app2b/)
    • app2n (http://localhost/app2n/)
  • app3 (http://localhost/app3/)
  • shared

Within each of the application groups “appGroup1” and “appGroup2”, the “common” folder contains assets shared by the applications in the corresponding group; this folder is aliased into each of the individual applications within the group to appear as if it were nested below the application folder (e.g., http://localhost/app1a/common, http://localhost/app1b/common). All of the applications reference the “shared” folder as a root level folder “/shared” (i.e., as http://localhost/shared).

Further, most of the applications have a default document that relies on SSI to function properly as part of the applications’ respective authentication and security framework. I also do all of testing and prototyping in a folder immediately off of my home folder; I will need to have that folder served by Tomcat/ACF10 just as it is currently under the other stack.

Finally, a caveat: I am a complete noob when it comes to Tomcat, so I will be learning as I go. I am almost certainly going to find sub-optimal ways to make portions of the work. If you see such mis-steps and have recommendations for other and/or better ways, please point them out in the comments on each post.

We have our work cut out for us. Stay tuned.

The Linux Merry-Go-Round Has Stopped

… or at least slowed so much that to those riding it, it appears to have stopped.

Since the time I jumped into the Linux waters for some of my computers at home and at work, I’ve done a significant amount of hopping between distributions. In the beginning, many of those jumps were simply out of curiosity to see what the different distros were bringing to the table and to get a better feel for the extent to which they easily supported my hardware. After the first couple years, the hopping took on a different purpose and became a bit more intermittent: I was looking for a distro that worked for me, not just on my hardware but for me personally (as well as for those who also used those same computers). I have a stack of CDs and DVDs of distros that I have tried to varying extents; that stack is approaching 8 inches in height (and it clearly doesn’t include all of the distros I’ve tried via bootable USB sticks or as a VM over the past couple years).

Arch Linux logoSo it is a bit of a shift, in many ways, for me to realize the merry-go-round has slowed, possibly stopped. I think I’ve found it. I’ve been running Arch Linux on my Asus netbook for  several months and it fits well: very good support for the hardware and for me personally. It has the packages I want, and I love the rolling release model that keeps packages current continuously as software projects release both major and minor updates (something that always bothered me to the point of kludging work-arounds in other distributions). Over the Christmas break, I moved my older Gateway desktop to Arch, as well. That is still a work in progress, as I am wrestling with a couple of items there but I have a fairly high degree of confidence I will resolve those. (And that’s a very different box with a very different usage profile than my netbook in terms of how I use it and how frequently.)

For now, I’m happy and don’t foresee any hopping in the near future. I absolutely do not miss the periodic upgrade-or-reinstall dance from the other distros I’ve primarily used in the past (Mint and Ubuntu being the two distros I spend the majority of the past 5 years living in/with). I like the pace at which new software versions, once release, make their way through the package management process. The package manager itself does everything I need it to in a very straightforward manner (even in situations where I’ve had to ignore updates to things like video drivers for my desktop’s antiquated graphics adapter). The software I want to use is present. The resulting systems, particularly given their older and/or low-end hardware, are stable and are far more responsive under Arch than any of the other distros I’ve had installed on them. The distro has an active and supportive community, along with a very usable and useful wiki.

Arch probably isn’t for everyone, but it works for me. (And it is the underlying aspect of this — having the availability of a broad spectrum of variations on a given OS, each with different strengths and philosophies to choose from — that makes me truly appreciate Linux, but that’s possibly the topic of a future ramble.)

Discuss.

More Assorted Shorts (11/2009)

More to come on some of these as we get our lives at least marginally back under control as soccer winds down for the fall…

  • We’ve got Halloween pix coming; you’ll want to keep an eye out for those in the next couple days!
  • On the Linux front, Ubuntu 9.10 is out as of late last week. I pushed one of my older boxes to it with reasonable success. Not much more there to say other than the startup and shutdown times are impressive, even on old hardware. Brown hasn’t done much for me lately.
  • The time change is wreaking havoc on our mornings at this point, particularly with Li.
  • The first pre-release of Firefox 3.6 is out, but I haven’t had a chance yet to pull it down and give it a try. At least on the surface, the only interesting aspect is the return of some eye candy regarding switching tabs. Also on the browser front, Google Chrome continue to progress, but the continued absence of the ability to control default font sizes on Mac OS X is mystifying.
  • Ian wrapped up his high school soccer career with a trip to the state tournament in Boise in late October. Odd to think that’s over and done with; odder to think that I am going to be saying that more and more over the next few months as he works his way through his senior year.
  • Done a bit of reading, although little of it was worth noting aside from “South of Broad” by Pat Conroy. I haven’t read anything by him for several years and this was a great reminder of how much I love his writing.
  • On the movie front, go see “500 Days of Summer” if you haven’t yet and can still find it in a theater. Best movie we’ve seen in a very long time.