Little T in the Cog apple

Archive for July 2013

PHP 5.4 on OS X 10.5 Leopard Server

2013-07-26

So after finally getting PHP 5.3 compiled and installed it looks like it's being end-of-lifed:

"Please Note: This will be the last regular release of the PHP 5.3 series. All users of PHP are encouraged to upgrade to PHP 5.4 or PHP 5.5. The PHP 5.3 series will receive only security fixes for the next year."

Rather than wait for support to end I thought I'd move to the next version, 5.4. Compiling PHP 5.4 on Leopard Server isn't too much harder than 5.3 but it does seem to trip up over OpenSSL versions - 5.4 needs OpenSSL version 0.9.6 or higher and Leopard ships with version 0.9.71 so it should be fine but I found that while it passed the "./configure" stage it failed when linking, giving errors right at the end of the "make" stage:

Undefined symbols:
  "_EVP_sha224", referenced from:
      _php_openssl_get_evp_md_from_algo in openssl.o
  "_EVP_sha256", referenced from:
      _php_openssl_get_evp_md_from_algo in openssl.o
  "_EVP_sha384", referenced from:
      _php_openssl_get_evp_md_from_algo in openssl.o
  "_EVP_sha512", referenced from:
      _php_openssl_get_evp_md_from_algo in openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
It seems to be because though the version of OpenSSL included is higher than needed it gets a bit confused by the version number (0.9.71 rather than 0.9.7.1 I guess?). The fix is to edit /ext/openssl/openssl.c (from the root of the php 5.4 tarball) and change the three instances of
#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
with
#if OPENSSL_VERSION_NUMBER >= 0x0090808fL
The 0x0090808fL isn't super important, it can be any value as long as it's above 0x00908. This disables some features (such as certain SSL algorithms) that OpenSSL 0.9.71 doesn't support. Once that file is changed you can kick off "make" again and it should complete without errors (following the guide for 5.3 here for configure options and support libraries - note that you no longer need the "-lstdc++" fix for ICU). If you're going to use APC (which you really should!) you need to run at least version 3.1.13 to work with PHP 5.4, the same configure options as used for version 3.1.9 can be used.

UPDATE: Just realised that the version of OpenSSL shipping with Leopard is 0.9.7l (with a small "L", not a number "1") so no idea why you need to hack the source file to get it to compile.


How to get some life out of an Xserve G5

2013-07-16

I've written a Howto on installing and patching OS X server on an Xserve G5. I'll probably keep adding to the Howto over time as I discover new things that need updating. If you're using a newer Intel Xserve then this howto will still work of course if you're running an older version of OS X Server, but to be honest seeing as Server is so cheap in the app store you're probably better off simply updating if you can :-)

Anyway I hope you find it useful - let me know if anything doesn't work for you!


New PPC Mac

2013-07-02

It couldn't last - I've just got rid of my last PowerPC computer (previously I've also owned a PPC Mac Mini and the mighty dual processor Quicksilver G4 PowerMac) about a month ago and I've gone and bought myself another one - this time an old G5 Xserve!

I've sorted out some very cheap colo storage for a 1U server so I needed something to put in there. It didn't have to be particularly fast as it will be mainly used for offsite rsync backups from my house and my brother's business but it did need to use SATA drives as these are way cheaper than SCSI when it comes to bulk storage. I was going to use an old HP DL360 G4 with twin SATA disks when I found the Xserve going cheap, so snatched that up.

It's a single processor 2.0GHz model with only 1GB RAM and my original plan was to put three 2TB SATA drives in it and install debian Linux across the top in a RAID 5. Turns out the server only has 2 drive caddies so I'm trying to find another one here in NZ which is proving problematic (there are a few on ebay but with shipping to NZ it gets quite expensive, nearly the same cost as a 2TB SATA disk). It also has no graphics card in it (a headless server, the graphics card was a build to order option on this model) which makes installing Linux on it a bit harder than it should be as I need to run the install over serial console.

While I scrounge around for another caddy I've installed OS X Server 10.5 on it (as OS X only supports software RAID levels 0 and 1 it doesn't really matter that I've only got two disks in it) which proved surprisingly easy as OS X is set up to start a VNC session with the machine's serial number as it's password if it detects there is no keyboard/mouse/display attached - if I can't find another caddy (or get Linux installed via serial console) I'd be tempted to leave OS X installed on there as I really only need SSH and a mirrored RAID both of which OS X provides.

And if nothing else, at the end of the day it looks pretty cool in the rack surrounded by the SuperMicros and HPs that sit above and below it :-) Now all I need to do is track down some more DDR PC3200 ECC RAM for it...