Upgrade your SuSE server

I run a SuSE 11 internet server providing some basic services.
I recently had to upgrade to a new version of SuSE (11.3) and it took my quite some time to do so.
Therefore I am listing here the necessary steps, hoping that the next time I will spend less time on such an upgrade…

Services installed

  • dovecot IMAP/IMAPS Mail Server
  • dovecot POP3/POP3S Mail Server
  • postfix SMTP TLS MTA
  • Apache HTTP/HTTPs Webserver
  • Subversion Repository
  • WebDAV online Disk
  • BIND DNS


Preparations and basic setup

  1. Take the server off-line and make sure no mail arrives. The emails will be queued on the alternate MX and delivered later.
  2. Do the backup (rsync including all deletions)
  3. Dump the installed packes to an XML using yast2 Software Management
  4. Install base software from boot ISO over the network
  5. Setup Networking
  6. Restore /etc/passwd
  7. Restore /etc/shadow
  8. Restore /home in the background



Setup Mail Server

  1. Setup postfix (check possibility to restore /etc/sysconfig/postfix from backup), but do not start
  2. Setup dovecot (restore /etc/dovecot/dovecot.conf), but do not start
  3. Check certificate values in /etc/sysconfig/postfix (or restore from backup)
  4. Create postfix certificates and SSL CA using mkpostfixcert
  5. Edit the config file /usr/share/doc/packages/dovecot/dovecot-openssl.cnf (attention, will be overwritten when upgrading dovecot)
  6. Run /usr/share/doc/packages/dovecot/mkcert.sh
  7. Download and install roundcube mail in /srv/www/htdocs



Setup Apache Webserver

  1. Setup apache2 (check possibility to restore /etc/sysconfig/apache2)
  2. Restore /etc/apache2/vhost.d from backup
  3. Restore /etc/apache2/conf.d/subversion.conf from backup
  4. Generate the following certificates for apache using yast2 (mail, svn, disk)
  5. Export the PEM encoded certificates to /etc/apache/ssl.crt|key/



Setup BIND Name Server

  1. Restore /etc/named.conf from backup
  2. Restore /etc/named.d from backup
  3. Restore /var/lib/named/master from backup



Setup MySQL

  1. Restore /etc/my.cnf from backup
  2. Restore /var/lib/mysql from backup



Setup Subversion

  1. If subversion is the same version (or compatible) just restore /srv/svn from backup
  2. If subversion is not compatible anymore use svnadmin load to load the dump from the backup



There’s noting to do for the WebDAV disk :)

After all the configuration files etc. have been restored and the settings in /etc/sysconfig have been checked, run SuSEconfig for the last time and test the mail server.
Unplug from the internet and start postfix and dovecot.
Check if a locally created mail is correctly handled by postfix, amavis and successfully delivered with dovecot.
Also check if the IMAP mbox is created in /var/spool/mail.

If this test succeeds we can restore /var/spool/mail from backup and connect to the internet again.

Now use yast2 to edit the runlevel configuration and make sure all the services are started at boot-time.
Also start them now.

Stored e-mails should no be delivered and correctly handled by the mail server.

Test all the virtual apache servers, webmail, subversion and WebDAV.

Gallery Included

I also included a small gallery to the site. The gallery content comes from my images server through a php script and the presentation is done using jQuery with livequery and slimbox2.

I had to use livequery because I wanted to add a lightbox effect to the asynchronously loaded DOM for the gallery content. That’s a common problem when dealing with ajax.

This is how it looks like now:

<head>
    <script type="text/javascript" src="http://js.madnet.ch/jquery-min.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/madnet-common.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/madnet-wordpress.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/jquery.livequery.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/slimbox/js/slimbox2.js"></script>
</head>
...
jQuery( function() {
    $("#g .gallery").livequery(function() {
        $(this).children("a").slimbox();
    });
    $("#g .galleryContainer").livequery(function() {
        $(this).click(function() {
            $(this).children(".gallery").slideToggle("slow");
        });
        $(this).children(".gallery").slideUp("slow");
        $(this).children("h3").hover(function() {
            $(this).fadeOut(100);$(this).fadeIn(500);
        });
    });
    $("#g").load("/galleryImages/AllImages.php");
});

Tuning Gigabit Ethernet on Mac OS X (10.5)

I recently bought a new NAS (Netgear ReadyNAS Duo) and attached it to my gigabit ethernet network. Unfortunately I only got transfer rates at around 10 MB/s which is really poor. I enabled Jumbo Frames (MTU > 1500) but this didn’t help much. So I did a bit more research and found out that the limiting factor was not only the MTU but the send and receive buffers.
This means my CPU was not able to catch up with the speed of the gigabit ethernet. What I did then was to increase the send and receive buffers for TCP/UDP traffic. É voilà! Now I get at least 35 MB/s. Still not the max a gigabit ethernet can offer, but I’m on the right way. I’d like to see something like 80-90 MB/s. Given the Samsung Disk can do at least 175 MB/s to/from buffer this should be possible.

I use the following parameters in my sysctl.conf:

kern.ipc.maxsockbuf=2500000
net.inet.tcp.sendspace=1000000
net.inet.tcp.recvspace=1000000
net.inet.tcp.mssdflt=7936
net.inet.tcp.delayed_ack=0

The buffers are probably too high, I know.

Switch

As I had to upgrade my 1.0 Joomla CMS to a more recent version anyway, I thought I should give WordPress a chance as well.

Hat off! Despite being a loyal joomla user for many years now, I must admit that wordpress looks like a fine piece of software to me. 
I’m so convinced that I will “switch” from joomla to wordpress during the next few days. 

I’ll not only change the blog system but also content wise I’d like to make a change… I try to post more often and be more focussed on the main topic “because technology matters”. I’ll post in english again as I plan to release articles about software development more often. And I can train my written english skills ;)