Technology

Automatic installations of turnkey Linux devices on virtual private servers

(Or how to set up a fully working Joomla, Drupal, LAMP, LAPP, Zimbra, Torrent, etc. server, in a couple of minutes)

Turnkey Linux included a suite of free applications based on Ubuntu software gadgets which are primarily available for server-type usage scenarios such as database, web, forum, wiki, and photo gallery server setup. Each device is pre-configured to work out of the box, with ease of use being the main goal behind the Turnkey Linux project.

This is extremely useful in itself, but if you wanted to experiment with these devices, potentially to test or test them, it would be great if you could install them with minimal effort.

Using turnkey Linux on virtual private servers

Several hosting providers offer Linux VPS services, which typically allow users to have their own virtual server with automatic provisioning from major Linux distributions such as Debian, Ubuntu, or CentOS. Working closely with the Turnkey Linux team, they have taken the concept of automatic installation one step further to allow it to work with all Turnkey Linux devices. This is possible by using frameworks provided by the excellent open source server control panel, DTC.

Turnkey Linux appliances allow users to easily deploy primarily web-based applications within a complete set of Ubuntu and Linux kernel-based packages. Once a distribution is chosen within the control panel, the installation is fully completed in a few minutes and is ready to be customized. This allows for rapid deployment of a proven configuration, with full updates and security support provided by Linux and Ubuntu turnkey package maintainers.

Our efforts are available to everyone using the DTC control panel, and Debian packages for Lenny are provided. In addition, scripts have been written so that when new or updated devices are released, new deployable packages for the DTC control panel are created and made available in our repository automatically.

technical script details

It’s actually not too difficult to configure images to work on autodeploy, but doing it manually for each device is a time consuming process. The scripts we have written will automatically perform the following steps for each device:

  1. Create a new directory with a name similar to the actual release version, for example turnkey-core-2009.02-hardy-x86.
  2. Copy to common template files. These include the following:
    • custom_os– Customize each device by configuring basic networks, generating gettys on the correct devices, and setting a custom MOTD with the VPS number and hostname.
    • install_os: Custom instructions for installing this device, which essentially consists of breaking down the image provided on the VPS.
    • configure_network: Custom instructions called when configuring the network. Since Turnkey Linux uses resolveconf for DNS configuration, this reads information from /etc/resolv.conf from dom0 (this is designed for use with Xen) and copy it to /etc/network/interfaces in the domU.
    • debian/*: These are the changelog, control, compat, copyright, files, install, and rules files that are required to create .deb packages. These have substitution variables (eg for the package name) that our script overwrites.
  3. Copy the pre-installed image (a.tar.bz2 file).
  4. Customize the template files (as above).
  5. Invoke dpkg-buildpackage in this directory to create the actual.deb file.
  6. Call faila tool we use to manage Debian repository directory structures, to remove old versions from this device and add a new one.

It’s as simple as that. If you are interested, the raw scripts can be downloaded. They will need some customization for their setup as there are hard-coded directories in there.

I want to play with one!

If you’re happy to play with just one device, you can download it from the Turnkey Linux website and install it on your PC (or use a virtualization solution like Xen or VMWare).

However, if you want to quickly test a variety of devices using the setup we’ve made, the quickest way would be to rent a VPS. Alternatively, you can install the DTC control panel yourself and add our Debian repository to your /etc/apt/sources.list. This setup requires you to run a fully featured Xen setup and requires significant configuration.

Any questions?