System upgrade openSUSE 11.0 to openSUSE 11.1 with zypper
I had to set up a server. The hoster offers openSUSE 11.0 at the moment but no openSUSE 11.1 yet. As I like to go with the latest and greatest I decided to upgrade the system to openSUSE 11.1 after using the hoster’s installation image for openSUSE 11.0. I searched on the web how a system upgrade should be done this time. (It seems to differ all the time.) I found a zypper command chain. Change the installation reposotories in /etc/zypp/repos.d to the new version and type:
# zypper refresh
# zypper dist-upgrade
I did excatly that. It did refresh a few packages but as I guessed immediately not enough. I tried over. It did not help. Here is the solution. Delete all subdirectories in /var/cache/zypper and execute the commands above again.
New software packages bundled with OpenSuSE 11.1
The newest version of OpenSuSE got released today. OpenSuSE 11.1 brings more than 230 new features the press release says. As I keep my systems up to date thanks to smart and all the repositories only a number of these new feature are missing on my OpenSuSE 11.0 installations. The most important reason I quickly upgrade my desktop system is KDE. As I am still using KDE version 3 and the version that comes with OpenSuSE 11.1 is the same I have installed (KDE 3.5.10) this does not convince me to upgrade.
I did however discover new software (packages) in OpenSuSE 11.1 I have not known before. These packages are Tasque, Tellico, Twinkle, Monsoon, PulseAudio and Derby. I googled these terms and came up with the following.
- Tasque is a simple task management app (TODO list) for the Linux Desktop. The screenshots remind me of the todo app that comes with the KDE Kontact tool.
- Tellico is a KDE application for organizing your collections. Tellico allows you to enter your collection in a catalogue database.
- Twinkle is a free software/open source VoIP softphone application for Linux. It uses the SIP protocol. It also incorporates a GPL implementation of the ZRTP and SRTP security protocols and MD5 digest authentication.
- Monsoon is a fully featured bittorrent GUI supporting many advanced features such as selective downloading, automatic port forwarding via uPnP and RSS integration.
- PulseAudio is a sound server for POSIX and Win32 systems.
- Apache Derby is an open source relational database implemented entirely in Java.
I’d like to say even before I tried it out openSUSE just got better!
The open source application stack for Windows
The bad thing with most new computers is that they come with Windows ™ preinstalled. The good thing is those Windows ™ installations don’t bring much (useful) software along. Users have to actively use which software they want to use.
Today I had to run updates on a new laptop which is given away in my family this year as xmas present. Needless to say I decided to install some software. The presentee is still at a very influential age. I should have installed Ubuntu or OpenSuSE but I ran with Windows to not upset the father. For all the applications though I was luckily enough to find open source software.
I installed OpenOffice for office stuff, Scribus for desktop publishing, Mozilla Firefox for surfing, Thunderbird for mails, Songbird for music, Miro and VLC for videos, The Gimp for pictures and painting and last but not least Inkscape for (vector) graphics.
The presentee will get a pretty powerful software package with no upfront cost and no hidden fees. As she is not settled with any programs this setup will open the whole world of open source software to her.
Apache and lighttpd replaced by nginx for PHP application
A while back I wrote an article Switching from Apache HTTP Server to Lighttpd - Installing Lighttpd. Back then I migrated static stuff to lighttpd but left the dynamic stuff (PHP) with Apache.
I was never really satisfied with the speed of our system under load. I tried and tried. I optimized a lot of stuff in the backend and with the database. Most of the time I found a switch to make the system just a bit faster. Read Retrospective on three years of Seagull development if you are interested in the whole story.
In the last couple of weeks I ran out of ideas on where to improve next (without the need of rewriting too much code). I remembered using Squid years ago. I had a look at the newest version (3.0) and my interest in Squid stopped pretty soon after reading through the documentation. It was just not the software I needed.
I dived into spreading the load to multiple backends using HAproxy which by the way has a super active community. Check the mailinglist. The maintainer Willy is doing a great job. Learning about HAproxy I stumbled across the webserver nginx (pronounced engine x) numerous times. Learning about nginx I stumbled across the reverse proxy Varnish which is the proxy solution I hoped Squid would be. Furtherdown the line I ran into PHP-FPM - the PHP FastCGI Process Manager - which should not stay unmentioned.
So I read lots of blog posts, mails from mailinglists, documentation, articles, visited several forums and also learned many new things in a few wikis. So after getting the idea I had my stack together: Varnish -> HAproxy -> nginx -> PHP -> MySQL
Time to test it out! Varnish comes in a relatively uptodate package for my favorite distribution OpenSuSE (currently running 10.3 on 6 systems). HAproxy is available in a fresh version. nginx is theoretically available. It cannot install it though because of a package management conflict. So I downloaded the source for the newest stable version (0.6.3 as time of writing) and compiled it.
# wget http://sysoev.ru/nginx/nginx-0.6.32.tar.gz
# ./configure –prefix=/opt/software/nginx-0.6.32 –user=nginx –group=nginx –without-mail_pop3_module –without-mail_imap_module –without-mail_smtp_module
# make && make install
I did not need to install any extra packages. Frankly spoken I do have all the packages for compilation of C/C++ installed.
# cd /opt/software
# ln -s /opt/software/nginx-0.6.32 nginx
I always set a symlink to the currently used package. That way it is easy to replace the package when new versions come out. I can compile and install the new version and just switch the symlink.
Next thing I had to compile was a patched PHP version. So download the sources at php.net and the patches at the PHP-FPM site.
Unpack the PHP source:
# tar xjvf php-5.2.6.tar.bz2
Patch the source:
# gzip -cd php-5.2.6-fpm-0.5.8.diff.gz | patch -d php-5.2.6 -p1
Configure PHP (adjust your settings accordingly):
LDFLAGS=”-L/usr/lib64″ ./configure –with-curl –disable-debug –enable-libxml –enable-session –with-pcre-regex –enable-xml –with-bz2 –with-zlib –enable-exif –enable-inline-optimization –enable-soap –enable-sockets –with-xmlrpc –without-pear –with-libdir=lib64 –with-mysql –with-mysqli –enable-mbstring –with-mcrypt –with-mhash –with-mime-magic –with-jpeg-dir=/usr/lib64 –with-png-dir=/usr/lib64 –with-gd –enable-gd-native-ttf –with-ttf –with-freetype-dir –enable-ftp –enable-zend-multibyte –with-openssl –enable-force-cgi-redirect –with-pcre-regex –without-sqlite –without-mm –enable-fastcgi –enable-bcmath –enable-fpm –quiet –prefix=/opt/software/php5.2.6-fpm
Compile and install:
# make & make install
Adjust the PHP-FPM settings to fit your needs. You can find more info on this and related subjects in the PHP-FPM documentation.
# vim /opt/software/php/etc/php-fpm.conf
Start PHP-FPM:
# /opt/software/php/bin/php-cgi –fpm
Have a look in the log files:
# /opt/software/php/logs/php-fpm.log
Now you can connect through your webserver to fast-cgi processes. I use nginx as webserver (see above). Advantages and disadvantes of fast-cgi vs. mod-based approaches et al have been covered elsewhere. For me this makes perfectly sense and works extremly well.
After playing around with Varnish for a while I decided I do not need HAProxy ATM. Varnish can do all the decisions I need to make based on HTTP headers. I configured Varnish’s config file (here: vcl.conf) by reading lots of examples on the net and trial and error.
If I find more time and anyone is interested I post more details on the configuration of nginx and Varnish. But for now I want to publish this post as it has been sitting here for a while already.
PS: If people say content is king they are absolutely right. But never forget in the internet speed is Kaiser!
Switching from Apache HTTP Server to Lighttpd - Installing Lighttpd
For our main web project we struggle to serve the pages as fast as we want and as people aspect. Server load is too high most of the time. We did many different kinds of optimization. Starting with rewriting part of the code, squeezing the database, compiling the software we need instead of installing precompiled packages, using all kind of cache strategies (database, template, bytecode), buying servers with more powerful cpus (dual core instead of single core, 64bit instead of 32 bit), stocking up on ram (up to 8 GB RAM now) and now exchanging certain layers of software.
Setting up my first lighttpd server was easy. Configure runs through as wanted with just a few options:
LDFLAGS=”-L/usr/lib64″ ./configure –prefix=/usr/local/lighttpd-1.4.18 –with-pcre –with-bzip2 –with-rewrite –with-redirect –with-zlib –disable-ipv6
I took the few configurations options I needed from the official docs. Everything works as aspected and is pretty straight forward. You can check the syntax with the -t switch:
sbin/lighttpd -f lighttpd.config -t
OpenOffice 2.3 not working on 64-bit cpu
I upgraded my OpenOffice installation to version 2.3.0.1 for a 64-bit intel cpu. After upgrading the packages the software would reliably hang on saving a document and generating a pdf. I downgraded back to the monolithic i586 version. Everything works just fine and as expected.
Open Source alternative for Camtasia under Linux
I have been thinking of creating my own screencasts for a while. Today I stumbled upon a screenshot of Camtasia studio which looked very promising. Unfortunately they do not offer a linux version. So I googled around for an open source alternative. The one thing I found is the Xvidcap project. Drawback with the software is that has not been updated since October last year.
So I installed Xvidcap
# yum -y install xvidcap.x86_64
You can record actions in a little window. Not as fancy as Camtasia but will do for the beginning.