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 Ubuntu-based applications software gadgets which are mainly available for server-type usage scenarios, such as database, web, forum, wiki, and photo gallery server setup. Each device is preconfigured to work out of the box, with ease of use being the primary 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.

Using turnkey Linux on virtual private servers

Various hosting providers offer Linux VPS services, which generally allow users to have their own virtual server with automatic provisioning of major Linux distributions, such as Debian, Ubuntu, or CentOS. We have worked closely with the Turnkey Linux team and have taken 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 server’s excellent open source control panel, DTC.

Linux turnkey devices 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 complete in a few minutes and is ready to be customized. This enables 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 all who use the DTC control panel, and Debian packages are provided for Lenny. In addition, scripts have been written so that when new or updated devices are released, new deployable packages are created for the DTC control panel and made available in our repository automatically.

Technical script details

Actually, it is not too difficult to configure the images to work in automatic deployment, but doing it manually for each device is a very 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 configuring a custom MOTD with the VPS number and hostname.
    • install_os: Custom instructions to install this device, which essentially consists of decomposing the image provided in the VPS.
    • configure_network: Custom instructions called when setting up the network. Because 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 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. Adapt the template files (as noted above).
  5. Invoke dpkg-buildpackage in this directory to create the current.deb file.
  6. To call reprimand, a 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 interested, the raw scripts can be downloaded. They will need some customization for their setup as there are hard-coded directories there.

I want to play with one!

If you’re happy to play with a single 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 fastest 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 configuration requires you to run a full-featured Xen setup and requires significant configuration.

Any questions?

Leave A Comment