that Sam guy

CyprixRPMS and Nginx upgrade

It’s been a while (12 months) since nginx was last updated for Mandriva 2010.0 which has left my server running 0.8.17 for a long time. However since nginx is currently at 0.8.35 and the 0.8 branch has now gone stable along with many new features and bug fixes (see the changelog), I thought now was the time to upgrade.

I checked around for a more up-to-date rpm for Mandriva 2010.0 but none currently exists. There is 0.8.41 and 0.8.53 avaliable for 2010.1 and cooker. So…. one of three decisions to make.

  1. Upgrade the server to 2010.1
  2. Use either the 2010.1 or cooker nginx package on my existing install
  3. Request a backport for 2010.0
  4. Backport the package myself

Since this is a stable server an entire upgrade is a big risk and 2010.0 has a longer support timeframe, option 1 can be ignored. The same can be said about running packages not designed for the system. There goes option 2.

I decided to do both option 3 (Mandriva Bug Report) and 4.

I’ve never built an rpm before and thought that it was about time to learn, especially as I’d like to build up to being a maintainer/packager for the recently forked Mageia. So I set up a 2010.0 64bit build server and a 64bit test server and started using the Mandriva RPM Howto.

I downloaded the cooker source rpm for nginx 0.8.53 and rebuilt it for 2010.0.

Success! nginx-0.8.53-2mdv2010.0.x86_64.rpm

Since I now have the rpms (and along with my desire to do more packaging) I decided to use genhdlist2 and my rsync server to create my own repository – CyprixRPMS.

Using my own repo I upgraded my main server to 0.8.53 after basic testing on my 64bit test virtual machine.

You can add my repo with the command below as root (or sudo) for Mandriva 2010.0 64bit.

urpmi.addmedia cyprixrpms rsync://proteus.cyprix.com.au::cyprixrpms/mandriva/2010.0/x86_64

If you have any feedback on my rpms please email me.


New server (with photos)

As part of an overall upgrade for my systems, I’m moving to a brand new server. It’s my first rackmount server at 1U high and will be going into a colocation centre soonish.

It will be running a variety of applications including:

  • Mandriva Linux 2010.0
  • Web Serving: Nginx, Apache 2.2, PHP 5.3
  • Mail: Postfix, Dovecot, RoundCube
  • DNS: PowerDNS, Bind
  • Database: MySQL
  • Virtual Hosting: VirtualBox

Server Specifications:

  • Intel SR1530HSH with S3200SHVL Motherboard. 320w PSU, 3x Hot Swap SATA HDD, 2x Gb Nic
  • Intel Q9550 Processor – 4x 2.83ghz, 12mb cache, e0 stepping
  • Intel Q9400 Processor – 4x 2.66ghz, 6mb cache, r0 stepping
  • 4x 2gb (8gb total) Kingston DDR2 800Mhz Ram
  • 2x 1Tb Seagate Hard Drives (in RAID 1)

Update: Unfortunately, the E0 stepping Q9550 is not supported for the bios of the s3200 motherboard, so I’ve had to switch down to the Q9400 with only 6mb cache :( .

Photos:

Intel SR1530HSH 1U Server - Front

Intel SR1530HSH 1U Server - Front

Intel SR1530HSH 1U Server - Rear

Intel SR1530HSH 1U Server - Rear

Intel SR1530HSH 1U Server - Top

Intel SR1530HSH 1U Server - Top

Intel SR1530HSH 1U Server - Inside

Intel SR1530HSH 1U Server - Inside


[Solved] WordPress automatic upgrade and nginx

With my slow move over to nginx I’ve been finding the odd niggle to solve. Today’s one was the inability for my wordpress installations to use the automatic upgrade facility whilst running on nginx. Instead it kept asking to fall back to ftp for upgrading.

On apache, this can occur when your wordpress directory does not have write permissions for the apache user. But I’d already checked that. So I got thinking…

Since nginx and php fastcgi are separate processes I checked the users they were running under – lo and behold the php-fcgi was running under root!!! Big oops! Solution: change php-fcgi to run as user nginx & group nginx (same as the nginx server under Mandriva). As I currently use the spawn-fcgi program I changed by init.d file to use the user and group options as shown below.

/usr/local/bin/spawn-fcgi -u nginx -g nginx

All fixed :)

At some stage I’ll post my init.d file for php-fcgi and my nginx configuration files once they become somewhat stable.


Migrating to nginx, php 5.3, mysql 5.1, mandriva 2010… and more

Lots going on at the moment. I’m migrating most of mine and my clients websites to nginx from apache in preparation for moving everything to a new server.

First thoughts? Nginx is super fast, reasonably easy to configure (once you figure out the php issues) and saves a heap on memory. Downside? I’ve had the odd niggle with moving old sites across – especially since I’m moving to php 5.3 and MySQL 5.1 at the same time, otherwise all good.

The other major change is the look of this blog. The old K2 theme was becoming an issue to deal with (mainly because I didn’t update it enough) so I’ve now moved to this lovely theme: inove. I’ve also done a fresh wordpress install of 2.8.4 and added pretty links – so anyone linking to the old structure might have the odd issue, but otherwise should be painless. Oh yeah – any images on the older posts (pre Aug 2009) are gone.

Anyway here is a list of upgrades currently underway:

  • php 5.2.x to 5.3.0
  • mysql 5.0 to mysql-max 5.1
  • apache 2.2/mod_php to nginx 0.8.10/php-fcgi
  • athlon64 2ghz 1gb ram to athlon64 X2 2ghz 2gb ram
  • mandriva 2008.x/2009.x to 2010.0 (Cooker)
  • wordpress 2.x.x to 2.8.4
  • mediawiki 1.x to 1.15.1
  • bind 9 to powerdns 2.9.22
  • and a few more that i’ve forgotten about

Favourite linux single line command…

Whenever you have pesky windows users on your network, your file system on any servers running samba start to gain extra, silly, “Thumbs.db” files.

If you’re like me and hate the things with a vengeance, you can get rid of every single one of them using the linux command line below.

updatedb;for i in `locate Thumbs.db|sed 's/ /\__/g'`;do rm -vf "`echo $i | sed 's/__/\\ /g'`";done;

Update 21 Oct 2009: added for loop with sed commands to safety handle spaces, round brackets and single quotes etc. in the file path