Posts Tagged ‘server’

DIY Linux Transmission Server


One of my favourite things about Linux is its ability to transform a formerly useless elderly computer into something really useful indeed. This is the first in a series of posts covering some great projects to breathe new life into old machines using Linux.

What’s the Project?

BitTorrent is a fantastically useful distribution mechanism – when downloading updated Linux distro ISOs, it regularly exceeds the speeds available through centralised (HTTP/FTP) download repositories, and the sharing of bandwidth and ease of distribution are a great fit for online communities and fan groups (Zappateers, for example). Unfortunately, BitTorrent tends to be a total disk I/O hog, constantly reading and writing tiny chunks of file all over your disk. This causes big slowdowns for all other running programs which need access to your hard disk, not to mention the stress it puts on the drive itself.

We’re going to use an old computer, GNU/Linux and the Transmission BitTorrent client to offload this resource-intensive process to a networked machine, freeing up your main machine to get on with business unfettered. Sacrificing convenience, however, is not an option. Therefore, we’re going to implement the following convenience features:

  • Administering the client through a web browser
  • Sharing content over the local network
  • Creating a zero-setup process for starting new transfers


Linux Command Line Dropbox Tips & Tricks []

The fantastic, wonderful, life enhancing file sync platform Dropbox is easily the best way to share your files between your (sometimes many) devices and across (sometimes many) platforms. Every computer you add to your account increases the redundancy of the data you have stored, and if you value your work it’s a real weight off to know your files are stored safely in multiple geographic locations.

Dropbox is super easy to set up for Mac OS X and Windows (although harder for some Linux distros), but if you’ve got a Linux server that you want to hook up, you’ll have to jump through some command-line hoops before you’re ready to go. Luckily, there’s a tutorial page on the Dropbox wiki which is really helpful and, provided there are no hitches, will get you up and running pretty quickly.

There are a couple of points I’d like to make in addition to the previously mentioned document to address a couple of issues I had when I first tried to install the Dropbox CLI Linux client:

  • Make sure you’re logged in as the user you’ll be accessing the files as when you install. Sounds obvious, but some people like to install with an outright ‘su -' rather than a regular ‘sudo' which can lead to syncing the files as root.
  • When you get to the stage where you’re ready to launch the daemon for the first time, make sure you return the command line. Instead of running…
    # ~/.dropbox-dist/dropboxd
    …do yourself a favour and add an & to the end:
    # ~/.dropbox-dist/dropboxd &
    Especially if you have one of the premium accounts (>2GB), the first sync is going to take a long time, so make sure you use the ampersand so you can carry on working in the mean time.
  • Once you’ve installed, grab the control script. You can get it from the Dropbox website by following this link – it’s mentioned on the wiki linked earlier, but is buried right down at the bottom of the page. It should be the first thing you download!
  • If you’re having trouble running the script then try installing ‘python2.6’ and running using:
    # python2.6
    Again, this is hidden at the bottom of the wiki and is dead important.
  • The three most useful commands for the script are:
    # python2.6 start
    # python2.6 stop
    # python2.6 statusThese three commands give you all the control you should need to proceed with your enjoyment of Dropbox on your headless Linux server.

So there’s a few tips and tricks I want to add to the excellent official Dropbox wiki page. As with everything I post on my site, these are collections of solutions I’ve had to either research from multiple sources, have worked out for myself or have had trouble finding answers for elsewhere, so hopefully I can save you some trouble and help you get up and Dropboxing in less time than it took me the first go around!

Hosting Multiple Sites on the Same Server Using Apache2

When I upgraded to my new server (Lumpy Gravy) and migrated my own site from my trusty HP DL380 to the new box, I took the opportunity to get better acquainted with one of the cornerstones on the internet, a piece of software you rarely ‘see’ but operates behind the scenes not just of this site but a full 59% of the entire internet – the Apache web server.

Apache2 comes as part of the ‘LAMP’ packages you are given the option to install when loading Ubuntu Server, and by forwarding port 80 to your machine you can start hosting web content quickly and easily.

But what if you wanted to host multiple websites from the same server? This is something I’ve had to do for the first time this week, and it’s all possible with a few simple configuration changes to Apache.


Porting a Virtual Machine to a VirtualBox Server

If you’re like me, you’ll have a few virtual machines in the stable on your main desktop computer, which isn’t always the best place for them. Virtual hard drives take up tons of room, and the machine itself will be a big resource drain on the host system. This task is ideally suited to a server, and if you use VirtualBox it’s easy to port your desktop VMs to the cloud, freeing up hard drive space, wiping out the resource toll and making the virtual machine accessible from any computer.

This technique is also really useful for tricky to install virtual machines, particularly those with installers requiring multiple floppy disks, which can be set up with ease on a GUI machine and then sent to the server for archiving/remote access.

i: Check Your Specs

Before opening any terminals or remote anything, you need to open VirtualBox on your desktop computer (I’m using Mac OS X but this process will be exactly the same under Windows or Linux). For this example, I’ll be porting a virtual machine containing Windows NT 4. Again, this will work fine for any guest OS.

When VirtualBox opens to the ‘VirtualBox Manager’ screen, highlight the machine you wish to port. The specs of the machine will appear in the right hand pane of the window (see fig 1).

fig. 1 – Check the specs of your VM

We need to recreate this environment as closely as possible on the server to maximise compatibility. Most of the time you’ll be using the default VBox hardware selection, but you still need to make sure that you match the other details with as much accuracy as possible.


DNS Registration

Finally in the big leagues, baby – a nice slice of ‘pro polish’ added to the site this morning in the form of my finally coughing up twenty quid to have Uncle Meat correctly registered, DNS-wise.

Previously, visiting this domain was a ‘window’ into the contents of the server’s IP, however the IP and the domain are now one and the same. Which means several things:

  • You can now see the full, correct URL of each post in the address bar
  • Google’s index will now be replete with the site name, rather than the external IP of the server
  • The RSS feed no longer displays the IP in the address bar (so update your aggregator!)
  • The site seems a little more responsive

It’s pretty cool to have all this business sorted now. And I learned all about DNS registration to boot, although the £20 fee was a bit of a crock (considering I’ve already payed for the domain). But I think that’s just about the last thing that was keeping the site in the minor leagues – and now I’m 2 legit 2 quit. Fo sho.