Jul 8

Wanted to share that Rackspace has an excellent collection of configuration guides for Ubuntu 10.04 server. Aside from Ubuntu they’ve got guides for every other big Linux distribution as well, such as Fedora, Red Hat, Debian and CentOS. I don’t use those distributions myself but thought it would be nice to mention it. Check their List of Articles for a complete list of Linux distributions. Aside from Linux they’ve also covered Windows Server 2003 and 2008.

  • Share/Bookmark

Jul 7

Now that I’m using a CloudServer I figured I had to do something about backups as well. I’ve been using rsnapshot at work for a few years now and it’s an ideal backup solution. Because rsnapshot (which uses rsync as its base) makes use of hard links backups are very efficient. Basically it means that if a file isn’t changed it’s not duplicated, but a hard link is created instead. This way only changed and new files get copied. Deleted files will eventually be removed as well as soon as one of the backups expires.

Using rsnapshot for file backups is easy and the configuration explains this easy enough. Backing up MySQL databases however is a different story. When using MyISAM tables you might get away with copying and pasting the database files. With InnoDB not so much. Proper backups can be made with mysqldump. In my case I don’t have many databases so I want one big SQL backup file.

First, lets set up our backup script. I’ve stored it under /usr/local/bin/backup_mysql.sh with permissions set at 0700. The reason for these permissions is that I store my password inside the script and only want root to be able to open it. It also needs to be executable. I know it’s better to use a configuration file and use source to include the variables, but for my current use it’ll do (do note at work I’ve done this the proper way!). I also use the root user instead of a special read-only user. I know this is bad practice, but again I’ve done this the proper way at work. It’s an exercise for you to do it properly (hehe, that’s another way to put that I’m lazy). Anyway, here’s the script.

  1. #!/bin/bash
  2. mysqldump –all-databases -uroot -pmypassword –opt > mysqldump.sql

Nothing exciting. Change the credentials as required. Again, use source if you want to store the credentials inside a proper configuration file. Now, calling this script ./backup_mysql.sh will backup all databases inside the file mysqldump.sql in the current work directory.

Next is setting up /etc/rsnapshot.conf which is easy as well. At the end of this file you’ll find all the instructions of which directories to backup. Enter the next line. Do note that rsnapshot.conf uses a tab to separate values.

  1. backup_script   /usr/local/bin/backup_mysql.sh  mysql/

To enable daily backups uncomment the next line:

  1. #interval       hourly  6
  2. interval        daily   7
  3. #interval       weekly  4
  4. #interval       monthly 3

To make rsnapshot run every day update /etc/cron.d/rsnapshot:

  1. # 0 */4         * * *           root    /usr/bin/rsnapshot hourly
  2.   30 3          * * *           root    /usr/bin/rsnapshot daily
  3. # 0  3          * * 1           root    /usr/bin/rsnapshot weekly
  4. # 30 2          1 * *           root    /usr/bin/rsnapshot monthly

Finally, try running rsnapshot. After it has run check your backup directory, which on Ubuntu 10.04 defaults to /.snapshots/. Be sure to mount /.snapshots/ on a separate drive. Because what use is it if your data drive contains your backup and decides to commit suicide?

$ sudo rsnapshot daily

Your MySQL backup file should now be located at /.snapshots/daily.0/mysql/mysqldump.sql. You can restore this file with the MySQL commandline client, or through MySQL Administrator from the MySQL GUI Tools.

  • Share/Bookmark

Jun 27

In an earlier post by me I described how to get open-vm-tools working in Ubuntu 9.10. Turns out that this doesn’t quite work for the latest version of Ubuntu, 10.04. A few tickets were spent on it at Launchpad and finally last night someone, I presume the module author, said you also need to install open-vm-dkms. Which I did. After this the module vmhgfs is available again and can be loaded.

So, when you install open-vm-tools and you want to make use of the vmhgfs driver you need to install open-vm-dkms. Otherwise compiling it yourself with m-a will fail. Note that with this step you no longer need to compile it yourself, as apt-get does it for you.

  1. sudo apt-get install open-vm-tools open-vm-dkms
  • Share/Bookmark

Apr 18

Which apparently is the slogan for launching Ubuntu 10.04. I think this is going to be a very nice LTS release. It’s too bad that they didn’t include Perl 5.12 in it, but that’s understandable as it just got released; although compiling your own is very easy. On the other hand, PHP 5.3 got in there thanks to the pressure of some fellow Dutchmen. Not that I’m a big fan of PHP, but PHP 5.3 has some nice additions such as closures.

  • Share/Bookmark

Feb 19

A little while ago I posted about waiting for Ubuntu 10.04 to be released to upgrade our webserver at work to. We were running Ubuntu 7.04 which already wasn’t supported anymore. Due to ClamAV stopping support for the specific ClamAV version on Ubuntu 7.04 we decided not to wait and upgrade as soon as possible. Which was earlier this week.

I had already created a well prepared upgrade procedure, which I finished somewhere in august 2009. Almost 5 months later I was happy to find out that upgrading was still a painless process and all went without problems. As upgrading from 7.04 to 8.04.4 isn’t directly possible I had to upgrade to 7.10 first, which also isn’t supported anymore. Luckily all the packages are still available online. Just not in the official repositories.

The only problem I’ve run into was with Postfix and the IMAP protocol. Some old accounts had their Maildir folder set to the user nobody (which was strangely deleted by the way). For some reason Postfix only accepts it when the group on the folder is users. All Maildir folders for the new(ish) accounts were already owned by the group users and didn’t give me any problems. A quick call chgrp fixed this issue.

Other than that no outstanding issues. So overall I’m VERY HAPPY with how painless upgrading from 7.04 to 8.04.4 was. Of course at the time I was working on my upgrade procedure there were quite some issues, such as HP Tools (hpasm, hpasmcli, hpOpenIPMI) not working. But all were resolved before doing the actual upgrade on the live server. In case of hpasm, in case somebody wonders, you no longer need the hpOpenIPMI driver, as there’s now a open-source driver for it called openipmi. No more recompiling this driver when upgrading the kernel :-) .

  • Share/Bookmark

Jan 10

So today I was busy configuring a install of Ubuntu 9.10 as a virtual server in VMWare to use as my home server for maintaining a Redmine installation, as well as hosting some old Subversion repositories and my private Git repositories. To my surprise vmware-tools did not work. Done a bit of searching and found out that 9.10 isn’t really compatible. It works fine in Ubuntu 8.04 by the way.

My main concern was that I couldn’t use the vmhgfs driver to mount directories on my host machine. It turns out open-vm-tools provides the same stuff as vmware-tools and is available in the Ubuntu repositories. Surprisingly after installing open-vm-tools and rebooting the vmhgfs wasn’t loaded, nor could I load it.

To get vmhgfs to work you need to do the following:

  1. sudo m-a

Go to SELECT. Mark open-vm in the list and go to OK. Then choose BUILD. Afterwards it’ll ask you to load the module. Answer with YES.

Next is setting up your mount point.

  1. sudo mkdir -p /mnt/hgfs
  2. # Give read-write access and allow exec. Files utf8 encoded.
  3. sudo echo ".host:/ /mnt/hgfs vmhgfs auto,rw,exec,utf8 0 0" >> /etc/fstab

Something is probably wrong with my configuration as my share won’t mount at startup. So I edited /etc/rc.local to mount the file at startup. My rc.local looks a little bit like this:

  1. mount /mnt/hgfs
  2. exit 0

Now reboot to make sure everything works as expected. It should.

  • Share/Bookmark

Nov 3

Today at work we decided to wait for the next LTS version of Ubuntu, 10.04. Currently we run 7.04 which is no longer receiving updates. For a while now actually. This summer I worked on planning the upgrade process from 7.04 to 7.10, and finally to 8.04. Which is the current LTS version.

I was able to do a dry run upgrade on our backup server. So I was able to document every step of the upgrade process. Ubuntu upgrades nicely and from 7.04 to 8.04 there are only minor changes that need to be done in our configurations. Even the HP iLO software, for which support on Debian based systems is a bit vague, works out of the box with a native driver. No longer do I need to manually compile the HP iLO driver after every kernel update.

Originally we planned on doing the upgrade somewhere this month or December. But due to tight schedules (it’s quite busy for us) January or February seemed be more likely. Since 10.04, the next LTS version with support until April 2015, is out in April 2010 it likely doesn’t hurt to wait a little bit longer. As far as I know every LTS version so far was easily upgradeable to the next LTS version. So I expect upgrading is going to be a breeze. But of course, I’ll be running tests first when 10.04 gets released.

Why not upgrade to 8.04 first and run that first for a couple of months? Well, support for 8.04 ends in 2013, so 10.04 gives us more years of updates. Also, the upgrade process takes (down)time, time to get there, man-hours that need to be paid etc. etc. Further more, without a doubt, with every upgrade there are some issues going to arise. Small and trivial or stuff that brings down every website that’s running on it. Resolving these issues also takes time, which delays the progress of other projects and what not. By skipping yet another version I think we’ll actually save time.

I’m looking forward to it actually. On of the cool things I’m looking forward to is being able to upgrade Zend Framework from 1.8 to 1.9+. I’m also planning to use memcached and perhaps some PHP optimizer to greatly speed up some of the webapplications. And of course, Perl 5.10 (perhaps 5.12 by then?). Although we, unfortunately, don’t use Perl for our websites I like to keep Perl up to date as we use it for several system administration programs. CouchDB also caught my eye :-) .

OK, enough for now. Bedtime :-) .

  • Share/Bookmark

Get Adobe Flash playerPlugin by wpburn.com wordpress themes