Archive for January, 2007

/proc/sys/net/huh?

Saturday, January 13th, 2007

You’ll often come across docs and how-tos that say things like “to enable forwarding issue the following command”:

echo 1 > /proc/sys/net/ipv4/ip_forward

Ever wondered what all that stuff in /proc/sys/net actually does? Ok, a lot of it is pretty logical, but sometimes it’s nice to actually know with a bit more certainty. Today I broke something on a server because I assumed, instead of looking it up. Oops.

There’s a lot of documentation in the kernel sources which is surprisingly accessible to the non kernel hackers among us. First, get yourself a copy of the kernel source if you don’t have one. Take a look in /usr/src. If you don’t see a directory called something like linux-2.6.18, you probably don’t have the kernel source available. If you’re on a debian, ubuntu or other apt-based distro, you can apt-get the source for your kernel:

cd /usr/src
apt-get source linux-image-2.6.18-3-k7

Once your kernel source has downloaded and unpacked, cd into the source directory. You’ll find a directory called Documentation, and inside that a subdirectory called networking. The document we’re looking for in this case is ip-sysctl.txt. Open it in your favorite text editor.

  
/proc/sys/net/ipv4/* Variables:

ip_forward - BOOLEAN
        0 - disabled (default)
        not 0 - enabled

        Forward Packets between interfaces.

        This variable is special, its change resets all configuration
        parameters to their default state (RFC1122 for hosts, RFC1812
        for routers)

  

Have a browse around - there’s quite a bit of other doco. There’s an index file, 00-INDEX that lists what’s what.

Getting the Zoom Media Plugin to work on a Joomla site

Friday, January 12th, 2007

I really didn’t want x11 installed on my webserver, but I finally caved today. I was trying to migrate the Doric Open Fencing website to a new server this evening. My girlfriend runs the site, which is joomla based and has chosen to use the Zoom Media Gallery plugin. Anonymous visitors had no problem, but logged in users encountered the following error:

PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed

Documentation regarding the pre-requisites for the Zoom Media plugin are a bit absent and I noticed I wasn’t the only person having hassles with this.

Installing php5-gd fixes the error, but leaves me with a load of bollocks (x11) installed on a server:

# apt-get install php5-gd
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
defoma file fontconfig-config libfontconfig1 libgd2-xpm libt1-5 
 libx11-6 libx11-data libxau6 libxdmcp6 libxpm4 ttf-dejavu 
 x11-common
Suggested packages:
defoma-doc psfontmgr x-ttcidfont-conf dfontmgr libgd-tools
Recommended packages:
libft-perl
The following packages will be REMOVED:
libgd2-noxpm
The following NEW packages will be installed:
defoma file fontconfig-config libfontconfig1 libgd2-xpm libt1-5 
 libx11-6 libx11-data libxau6 libxdmcp6 libxpm4 php5-gd ttf-dejavu 
 x11-common
0 upgraded, 14 newly installed, 1 to remove and 0 not upgraded.

Given that the server is a Xen virtual machine, which doesn’t support X11 display (unless you go to some trouble to make it work), this is even more bizarre. Why does it work? Note the memory errors on install:

Unpacking x11-common (from .../x11-common_1%3a7.1.0-9_i386.deb) ...
/dev/mem: mmap: Bad address
/dev/mem: mmap: Bad address
Selecting previously deselected package libxau6.
Unpacking libxau6 (from .../libxau6_1%3a1.0.1-2_i386.deb) ...
Selecting previously deselected package libxdmcp6.
Unpacking libxdmcp6 (from .../libxdmcp6_1%3a1.0.1-2_i386.deb) ...
Setting up x11-common (7.1.0-9) ...
/dev/mem: mmap: Bad address
/dev/mem: mmap: Bad address

Selecting previously deselected package libx11-data.
(Reading database ... 13474 files and directories currently installed.)
Unpacking libx11-data (from .../libx11-data_2%3a1.0.3-4_all.deb) ...
Selecting previously deselected package libx11-6.
Unpacking libx11-6 (from .../libx11-6_2%3a1.0.3-4_i386.deb) ...
/dev/mem: mmap: Bad address

If X11 doesn’t work on Xen, then why do I need to install all this extra guff to get some uppity plugin working? *grizzle* Clearly there’s a bunch of stuff being installed here that isn’t used.

Google Toolbar PageRank Updated

Thursday, January 11th, 2007

Google PageRank is a live animal. Google Toolbar PageRank is not. Toolbar rank is updated approximately every three to four months. Today appears to be the day. Yesterday this site had a PageRank of 0/10, today it’s leapt to 3/10. It was about due. The last update was around September 2006. The website of my open source hosted applications business, Gladserv, which was launched a month ago, has jumped from nothing to 3/10 also.

There were other clues. I monitor the PageRank of sites under my control fairly carefully. None had changed at all in months. I was reading an article about PageRank updates yesterday which mentioned the PageRank checker: ezer.com. I’ve tried a few of these kind of sites before, and most of them are rubbish. Yesterday ezer showed mostly 0/10 for this site, with a few 3/10’s. Today it’s showing mostly threes and a couple of zeros. I guess the propagation of this update is almost complete.

My former software and web design business, Gladsoft (Gladsoft is dead! Long live Gladsoft!) has fallen off the PageRank charts completely. About time. For six months last year I had it displaying the apache test page. Late last year, as it still had a PageRank of 4/10, I decided to make it useful. I was still getting a large number of enquiries from people looking for web design services, so I put some Google ads up and a few links to companies I’ve dealt with that might be able to help them. Share the PageRank love, that sort of thing. There are still a good few sites out there linking to it, so I imagine it will resurrect itself Googlewise next time there’s an update.

Exim 4.66 *blink* released

Wednesday, January 10th, 2007

The versions are coming thick and fast. Seems I’m not the only one who was busily working through the holidays. This time its listed on the the exim site. A few bugfixes from 4.64 & 4.65.

I’m up to my elbows in various projects at the moment, rebuilding my MTAs being one of them. I’m converting my old sendmail/postfix MTAs to exim and separating out the functions onto different Xen virtual machines. Where possible, for maintainability, I like to stick with pre-rolled Debian packages unless I have a reason not to do so. Exim is one case where I like to roll my own.

Much of the exim config is best built into the binary at compile time. One example is logging. Exim needs to know where to write logs before it reads its config (in case it needs to log the fact that it can’t read its config). If you want to log to a non-standard location (or use syslog), then you need to tell exim at compile time. You will also need to compile from source if you want to specify which user exim runs as or if you want to compile out unused transports and lookups for security/performance reasons.

Fortunately, exim is pretty easy to put together, and local makefiles are mostly transferable from one version to the next so its easy to maintain your own package. I run three separate daemons for the external mail exchanger (mx), local delivery (mailstore) and outgoing smtp. Building and maintaining these is straightforward - I’ll be putting a how-to up on this site in the next week or so.