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 set of free applications based on Ubuntu software appliances which are primarily available for server-type usage scenarios, such as setting up database, web, forum, wiki, and photo gallery servers. Each device is preconfigured to work right 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 evaluate or test them, it would be great if you could perform installations with minimal effort.

Use of turnkey Linux in virtual private servers

Several hosting providers offer Linux VPS services, which usually allow users to have their own virtual server with automatic provisioning of major Linux distributions such as Debian, Ubuntu, or CentOS. Working together with the Turnkey Linux team, they have managed to take the concept of automatic installation one step further to allow it to work with all Turnkey Linux devices. This is made 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 Linux kernel and Ubuntu-based packages. Once a distribution is chosen within the control panel, the installation is completely complete in a few minutes and is ready to be customized. This enables rapid deployment of a proven configuration, with full upgrades 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. Additionally, 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 the images to work on auto deployment, 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 in common template files. These include the following:
    • custom_os– Customize each device by setting up basic networking, generating gettys on the correct devices, and setting up a custom MOTD with the VPS number and hostname.
    • install_os: Custom instructions to install this device, which essentially consists of decomposing the provided image 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 copies it to /etc/network/interfaces in the doM
    • 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 overrides.
  3. Copy the pre-installed image (a.tar.bz2 file).
  4. Adapt the template files (as above).
  5. Invoke dpkg-buildpackage in this directory to create the actual.deb file.
  6. To call faila tool we use to manage Debian repository directory structures, to remove old versions of 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 try out 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 full-featured Xen setup and requires significant configuration.

Any questions?

Leave a Reply

Your email address will not be published. Required fields are marked *