Automatic Installs of Turnkey Linux Appliances on Virtual Private Serv…
(Or How to set up a fully working Joomla, Drupal, LAMP, LAPP, Zimbra, Torrent server etc., in a associate of minutes)
Turnkey Linux comprises a set of free, Ubuntu-based software appliances that are chiefly obtainable for server-kind usage scenarios, such as setting up database, web, forum, wiki and photo gallery servers. Each appliance is preconfigured to work out of the box, with ease of use being the dominant goal behind the Turnkey Linux project.
This is extremely useful in itself, but if you wanted to experiment with these appliances, potentially to estimate or otherwise test them, it would be great if you could perform installations with the absolute minimum of effort.
Using Turnkey Linux on Virtual Private Servers
A number of hosting providers out there provide Linux VPS sets, which usually permit users to have their own virtual server with automatic provisioning of major Linux distributions, such as Debian, Ubuntu or CentOS. Work has been performed in conjunction with the Turnkey Linux team and has managed to take the automatic installation concept one step further to permit this to work with all Turnkey Linux appliances. This is made possible by using frameworks provided by the excellent server open source control panel, DTC.
Turnkey Linux appliances permit users to easily deploy chiefly web-based applications within an complete Linux kernel and Ubuntu-based package set. Once a dispensing is chosen within the control panel, the install is fully completed within a few minutes and ready to be customised. This enables a rapid deployment of a tested setup, with complete update and security sustain provided by the Turnkey Linux and Ubuntu package maintainers.
Our efforts are obtainable to all using the DTC control panel, with Debian packages for Lenny being provided. Additionally, scripts have been written such that when new or updated appliances are released, new deployable packages for the DTC control panel are produced and made obtainable in our repository automatically.
Technical Script Details
It is not truly too difficult to configure images to work for automatic deployment, but performing this manually for every appliance is a time consuming course of action. The scripts we have written will automatically perform the following steps for each appliance:
- Create a new directory with a name similar to the actual release version, e.g. turnkey-chief-2009.02-hardy-x86.
- Copy across shared template files. These include the following:
- custom_os: Customises each appliance by configuring basic networking, spawning gettys on the right devices and setting a customised MOTD with the VPS number and hostname.
- install_os: Custom instructions to install this appliance, which essentially involves untaring the provided image into the VPS.
- setup_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 the dom0 (this is designed for use with Xen) and copies it to /etc/network/interfaces in the domU.
- debian/*: These are the files changelog, control, compat, copyright, files, install and rules which are required to create a.deb packages. These have substitution variables (e.g. for the package name) which are overwritten by our script.
- Copy the preinstalled image (a.tar.bz2 file).
- Tailor the template files (as above).
- Invoke dpkg-buildpackage in this directory to create the actual.deb file.
- Call reprepro, a tool we use to manage Debian repository directory structures, to remove old versions of this appliance and add the new one.
It’s as simple as that. If you are interested, the raw scripts are downloadable. They will need some customisation for your setup as there are hard coded directories in there.
I want to play with one!
If you are happy playing with just one appliance, you can of course just download it from the Turnkey Linux website and install it on your PC (or use a Virtualisation solution like Xen or VMWare).
However, if you want to rapidly try out a variety of appliances using the setup we have made, the quickest way would be to rent a VPS. Alternately, you can install the DTC control panel yourself and add our Debian repository to your /etc/apt/supplies.list. This setup requires you to run a fully featured Xen setup and requires meaningful configuration.