Weer eens Woon-Werk-Woon

June 17th, 2008

Zo, vandaag voor het eerst in 2 weken weer woon-werk gefietst. Heerlijke route door mooi landelijk gebied in het begin vanaf Utrecht tot Amstelveen, en vanaf daar een snelle rechte Schipholweg naar Haarlem. Genieten van het mooie weer en de mooie omgeving.
In de twee weken blijkt de route tussen Breukelen en Wilnis ondertussen opnieuw geasfalteerd te zijn en de rare scherpe drempels zijn verwijderd. Een flinke verbetering. Ook is hier en daar de berm gemaaid wat vooral de bochtige landelijke weggetjes een stuk prettiger maakt omdat je nu veel meer overzicht hebt en tegenliggers op tijd aan ziet komen.

Al kon ik nog redelijk doorrijden (gemiddeld 33,5 op teller, +6% tellerafwijking -> 35,5km/h) ik merk wel dat ik lange tijd niet fatsoenlijk gefietst heb, door drukte en ziekte. Ik vraag me af wat dat gaat worden met Cyclevision komend weekend…
Toen ik samen met Hans, Hans, Ellen en David afgelopen zondag de baan in Sloten heb verkend, lijken de hobbels op de buitenbaan helaas erger te zijn geworden vergeleken met vorig jaar. Ik wou na het werk nog even op bezoek bij Sloten om zelf een rondje met de Quest te rijden, maar ik heb het aan het eind van de dag redelijk gehad, en Bob Vroegh belde me op dat hij van IJmuiden naar z’n kersverse nieuwe onderkomen in Renkum ging fietsen, dus de keuze was snel gemaakt om gezellig met z’n 2en direct door naar Utrecht te rijden.

Vandaag: 122km
Route: google maps KML GPX

New server for Colo (RAID-1, Debian with vservers)

June 9th, 2008

Yesterday and today I’ve set up a new server for colocation.
Properties and Features:

  • celeron 2GHz
  • 2,5GB mem
  • 2×500GB ordinary sata disks in RAID-1
  • debian etch installed on it
  • serial console (both grub and linux itself)
  • all it will serve and compute nicely sorted and devided in vservers

This was the first time I’ve installed a system in RAID and with serial console.

First thing to do was buying the hardware and wire and install everything properly.

Next thing to do was to check everything works in the BIOS. Nice to see 2,6GB RAM and 2×500GB disks in the BIOS startup screen at once without any trouble.

Then install the operating system. I attached an old DVD drive to the mainboard to start up from CD-ROM.

Server when installing

The choosen disk layout will be:

  • both disks a 200MB boot partition and a near-500GB system partition as linux-raid
  • combine partitions on each disk to md devices
  • install ext3 for /boot on the first 200MB md and install LVM on the big second md for al the other partitions
  • in LVM partitions:
    • root 512MB
    • /usr 5GB
    • /var 3GB
    • swap 3GB
    • /tmp 1GB
    • /home 20GB
    • /home/mail 10GB optimized for Maildir, 1 inode per 4kb (news options) and mount options noatime, nosuid, noexec
    • /home/backup 25GB
    • /var/local/nntpcache 2GB news cache spool, 1 inode per 4kb and mount options noatime

    This will be enough for a while in the future. I left almost 400GB of non-partitioned space on LVM, which can be used to extend volumes or add volumes for future expanding.

To fix this with de debian installer:

  • First create a DOS label on both disks
  • Create on each disk a 200MB for booting and a second partition of almost 500GB for LVM. Partition Type fd (linux-raid). Give the 200MB partition a boot flag.
  • Set up RAID, couple both 200MB and the near-500GB partition to two RAID-1 devices, md0 and md1
  • setup the 200MB md0 device to format as ext3 and use /boot as mount point
  • setup the big md1 device to use as LVM
  • setup LVM: make a volume group on the LVM device (I named it raid1)
  • create logical volumes like root, swap, usr, var, etc.
  • close the logical volume manager setup
  • format all logical volumes properly (I choose ext3) and give it mount points
  • finish partitioning!

After partitioning and installing base .deb packages I choose to install only the standard system set of packages. All other functionality will be in the vservers, which are already there and will be copied from the old servers.

Unfortunatly the debian installer left me no choice between boot loaders, I had to use lilo as boot loader. Strange, since I left a boot md0 specialy to use with grub. I’d like grub rather than lilo because if I once forget to run lilo properly after a kernel upgrade, I’ll get stuck with an unbootable server and need to travel to the colocation to fix up things. Grub will always work with serial console even if it can’t find a kernel, because it can load kernels dynamicly from the grub CLI.

After reboot I noted two things:

  • the installer didn’t use my seperate /boot partition at all, although I’m sure I’ve setup a ext3 formated /boot file system for it in the installer. The md0 device was left ext3 formatted by the installer. Bug somewhere?
  • The raid had to be build up according to /proc/mdstat and it took hours… I just left the server on without reboot to finish this, since I don’t know if rebooting before with slow down or restart the process…

Next thing to do is to install grub and get it work with serial console. More on this later…

Hello world!

June 8th, 2008

Launched my first blog post after installing WordPress! Wow….

I installed wordpress in a codebase -> symlink jailed public_html structure. So the WordPress code is seperated from the blog specific content. On this way Wordpress can easliy be upgraded, and I can easily create another independend blogs.

  • ~/wordpress/ contains all unchanged wordpress code and can be upgraded by extracting a new tar ball.
  • ~/public_html/bastiaan/ contains a symlink jail to ~/wordpress/
    Non-shared items like wp-config.php are just individual files.

I had to hack a new ~/wordpress/wp-config.php so it uses the wp-config.php from the link jail directory (found by $_SERVER['SCRIPT_FILENAME']):


/* 2008 Bastiaan Welmers haasje@welmers.net - wp-config.php usefull for symlink jails */
$dir = dirname($_SERVER['SCRIPT_FILENAME']) . '/';
for ($i = strlen($dir); $i > 0; $i–) {
    if ($dir[$i] == '/') {
        if (file_exists(substr($dir, 0, $i) . '/wp-config.php')) {
              include(substr($dir, 0, $i) . '/wp-config.php');
              break;
        }
    }
}
?>

Update: fixed code block :D