NSLU2-Linux
view · edit · print · history

Web/Mail server, DebianSlug

I previously had a full-size PII 333Mhz machine running Ubuntu being a mail/web server. It's fine, but is a big hulking box and it draws 40-60Watts and, well, the slug is groovy.

My Slug has been through some incarnations:

  • I started with OpenSlug
  • then OpenDebianSlug, using NFS mounted root disks
  • DebianSlug sounded much more appealing and a laptop drive became available. I got a cheap USB enclosure and installed Debian using the Debian-installer method (which I discovered is not DebianSlug, but NSLU2/Debian). I was using an old drive, so I then bought a new one, as an older laptop drive may not be wise for a 24/7 server (must remember to backup frequently!). I was also suffering from network problems - ssh connections would drop many times a day
  • so, I decided to try 'real' DebianSlug, via the Bootstrap method. That's where I am now.

It's currently a mail/web/webmail/http proxy server. Each step has been very easy (I am Linux-literate) - combination of the power of Debian apt-get and help from the Ubuntu wiki.

It seems to be using only a little swap, and performing very well for my household.

The Installation

Just followed the bootstrap instructions. This seemed to install exim4, which I didn't want, but apt-get remove --purge ".*exim.*" seems to do the trick.

Edited /etc/hostname and /etc/hosts to something nice.

ntpdate

I installed ntpdate - had to change its config to us.pool.ntp.org to get it to work. I've added a cron entry to run /etc/init.d/ntpdate reload every day to keep the clock on track. Less resource hungry than a full ntp server setup.

lighttpd

Much less resource-hungry than Apache. I have previously used Apache2, but I have a simple site, and the move was painless and the config clear. It feels faster on my local network than Apache did on the PII 333 machine!? Given that I'm operating on a domestic cable modem, the power of the slug is not the weak point in the system!

Mail

I went with the Ubuntu suggestions of Postfix, with Dovecot for imap(s) - easy, and clear, following the Ubuntu wiki instructions.

ssh to the world

Wanting ssh access from the wide world, I did a couple of things for security - disabled password logins, and force private key auth, and on my router, forwarded an unusual, high port to the slug ssh (security-through-obscurity is at least an improvement). Also disabled root login via ssh.

Privoxy

I installed privoxy as an http proxy, so I can ssh from work, and forward ports for imaps/smtp/http proxy. e.g.:

    ssh -f -N -Llocalhost:8118:localhost:8118 <<myhost>>

gives you an apparent web proxy on my work machine, that is actually the proxy on my home slug, and the added advantage of filtering out ads. It has to be configured to accept connections from any host.

Webmail - Squirrelmail

If you try to apt-get install squirrelmail, it stupidly insists on trying to install apache2, so instead I went to its homepage and downloaded the tar file. I simply untarred it in the web directory, name it something nice, and apt-get install php4-cgi, then followed the instructions in the INSTALL file (run conf.pl). I couldn't get it to work with imaps (and there's little point), so had to enable imap in dovecot.

The other thing, was to set up https, as Squirrelmail sends passwords in cleartext, so from looking around the lighttpd.org doc, I set up https, and a redirect from the mail http url to https. Pretty easy.

Todo

work out a spam filtering option (bogofilter?).

view · edit · print · history · Last edited by JimmyFergus.
Originally by JimmyFergus.
Page last modified on July 22, 2006, at 06:51 PM