Tag Archives: SheevaPlug

Two servers: SheevaPlug and Amazon

After my SheevaPlug died, I was in search for a new (temporary) host. I decided on Amazon AWS, because it allowed me to set up my own server, use the software I want, and configure it the way I need to. The SheevaPlug itself was quickly repaired, but I decided to keep Amazon. Why? Because the server there is actually a bit faster then the SheevaPlug. Although the SheevaPlug could run dynamic web pages (such as this blog), it was not ideal, and pages loaded slowly. Most web pages were served statically.

But running Amazon AWS also has its disadvantages, especially with mail. The service offered by Amazon is great for spammers. You can set up a server, send all the spam, and cancel the account. For this reason, Amazon limits the number of mails you can send from an Amazon account. Even worse, many mail providers block all mail from Amazon. Hotmail is one such provider. If you try to send a mail to Hotmail, you get a quick message back, that mail is refused.

To solve this, I had to “split” the server. Web pages are still hosted at Amazon, but the mail server is hosted at the SheevaPlug. It was a bit complicated to set up, but it all works beautifully now. If a web page (on Amazon) now tries to send a mail, it used postfix. In postfix, the relay SMTP host is set to the web address of the SheevaPlug. So all mail is first send to the SheevaPlug, and only then to the addressee. The web mail is still hosted at Amazon, but it reads the mail from the SheevaPlug. Newly received mail is delivered directly to the SheevaPlug. This can be achieved by setting MX-1 DNS record.

The SheevaPlug died…

This Friday my SheevaPlug suddenly died. All that was left was a device with the green blinking LED. Nothing worked, including the serial interface, which should always work. Searching the web, it turns out this is a problem with the power supply (PSU). Apparently it happens more often. My SheevaPlug was still under warrenty, so NewIT will replace the it. Unfortunately, the new PSU is not available until January. So what to do with all the sites that I run on my SheevePlug’s web server?

I decided to use Amazon EC2. You can place your own virtual server in Amazon’s cloud. When you sign up, you get one micro server for free. Such a micro server is even a little bit faster than the SheevaPlug, so that it an added bonus. Because you run your own server, you can choose whatever OS you want (I choose Debian, only Lenny was available though), and you can set it up the way you want it. So it was an easy process of copying all the data and configuration files to the new server. Within a couple of hours, the web server was up and running again. There seems to be some cost to data transfer out from the server (so for every web request). But it is a ridiculous low $0.01 per GB. After two days I used 7 MB, so I’ll take a while before I have to pay 2 cents.

It’s not all bad, because when I had to set up a new server, I could use my own articles. I could updated some articles, to include extra information, or correct some errors.

Update 1: First problem found. Hotmail refuses all mail sent from Amazon EC2 servers, because the IP range is listed in Spamhaus’ Policy Block List. So you would need to use an external SMTP relay host.

Update 2 (28 December): I received a new PSU from NewIT today. Installing this was easy. The SheevaPlug is now working again. Very quick response from NewIT.

Installing a new kernel on Debian

Update: If you install it using another method, the kernel can simply by updated with the standard APT update tool. However, there is a bug in the kernel update script. After the update, the USB drive is not longer recognised. It has the error sd_mod: Unknown symbol scsi_verify_blk_ioctl. To fix this, you must flash the kernel to the internal memory with (it might be needed to install flash-kernel first): sudo flash-kernel

Original post: I installed my SheevaPlug with Debian on an SD card using the alternative Debian install method. This works great, with one minor drawback: the kernel is never updated by Debian package management. Luckily, it’s not that complicated to install a new kernel. Sheeva with Linux publishes kernels for the Sheevaplug. There is also a script to update the kernel. On my Sheevaplug however, I could not use this script. The kernel is saved on a small boot partition of the SD card. This partition is too small to copy a new kernel to. Manually doing all the steps is straightforward too.

  1. By default, the boot partition of the SD card is not mounted, so mount it to /boot:
    mount /dev/mmcblk0p1 /boot
  2. Make backups of the file that will be overwritten. This include the file /boot/uImage and the folder /dev/firmware
  3. Go to Sheeva with Linux and choose a kernel, the latest will be fine. At the time I did this, this was 2.6.35.2. Download the files sheeva-*-uImage, sheeva-*-System.map, and sheeva-*-Modules.tar.gz. Just save them in your home directory
  4. Execute the following commands to extract the new modules and install the symbol table (replace {ver} with the kernel version you downloaded, e.g. 2.6.35.2):
    tar x -C / --overwrite -zf sheeva-{ver}-Modules.tar.gz
    depmod -eF /boot/sheeva-{ver}-System.map {ver}
  5. Remove the old kernel and copy the new kernel:
    rm /boot/uImage
    mv sheeva-*-uImage /boot/uImage
  6. Reboot with the command reboot

The SheevePlug should now reboot. After a minute or so, you should be able to log in again. Use the command uname -a to check if the new kernel is running. If something goes wrong, you can remove the SD card from the plug, put it in another computer and restore the backup files. I did everything from a SSH session. If you want more information (e.g. the error message during boot), you can do the upgrade over a USB terminal connection.

Introduction

NSLU2
The NSLU2, my previous server

I run my own web server at home. This little computer is my web server and mail server. I used to have a NSLU2 with Debian Linux. The NSLU2 (also known as Slug) is a little NAS that can also run some software. The NSLU2 has a 223MHz processor and 32MBRAM. That’s not a lot, but it was enough to run a simple web server, a mail server, and a DLNA server. There were some limitations though. The web server could only server static pages – things with server-side scripting (PHP), or databases (MySQL), are simple to heavy for that server. Having a big list and serving that through a DLNA server also caused problem.

So I decided to upgrade my little server. The requirements were a little, silent, and low-energy server. I decided on the SheevaPlug, a small plug-shaped computer. It has 1.2GHz processor, 512MB ram, 512MB internal flash memory, one USB port, a slot for memory cards, and a network port. This thing is a lot faster. It still runs Debian, with a web server, a mail server (IMAP and SMTP), it can download torrents, it is a DLNA media server, and it is powerful enough (sort of) to serve things like WordPress through PHP and MySQL.

SheevaPlug
And my new server, the SheevaPlug

While maintaining this server, I discovered a lot of things. Little tweaks that make the whole system run better. Or changes that I had to make the make the software run. I finally decided to publish all those things on a web site. In the first place, so I can’t forget, but also because other might run into the same problems.