Archive

Posts Tagged ‘10.6 Server’

Mac Mini Server

March 10th, 2010 staze No comments

In late January, I was able to upgrade my server to a Mac Mini Server. This is a pretty sweet little box. 2 500GB HDs, 4GB of ram, Intel C2D 2.53ghz. No optical drive, but that’s fine with me, since you can use remote drive, or purchase one of the USB optical drives for the MacBook Air.

Initial setup was quite easy, once I found a copy of “Remote Install” to run on my PowerMac G5. This utility is basically “NetBoot” in an extremely simple interface. It allows the Mini Server to netboot the install DVD. I then changed the HDs to be in a RAID1, and installed 10.6. That took a bit, but other than that, it was quite painless.

bonnie++ reports look like:
/usr/local/sbin/bonnie++ -d / -s 8G -u root:wheel -qfb
server.example.com,8G,,,58807,12,27984,5,,,110101,8,212.3,0,16,12352,59,+++++,+++,
8137,47,543,5,+++++,+++,231,3

Which, isn’t bad at all for dual 5200rpm drives. The machine shipped with two Hitachi HTS545050B9SA02.

Upgrading from the previous server (a Powerbook G4, 1.67ghz, 2GB of RAM, and a single 80GB HD) to this new machine was, to put it simply, breathtaking. The average load on this new machine is consistently less than 0.05, yet on the old PB, it was often upwards of 0.50. So, by that regard, about 10x the performance (realistically, probably more like 6-8x as fast). =) Also, there is a noticeable improvement in performance of the Drobo. I’m pretty sure the FW800 port on the Powerbook is flakey. Added bonus is the 64-bit nature of the new machine… which is really quite nice (really the main time I’ve encountered it is playing with bigint’s in PHP). Also means I can upgrade the ram to 8GB when the prices come down on DDR3 SO-DIMMs.

Add to that the fact that I can now run 10.6, and am not suck with the PPC OS’s, it’s great.

The only thing Apple could have done better? Remove the Mini-DVI port and add a second gig-E port. If they did that, I could probably start using these things at work rather than Xserves. =) Especially if I had an iSCSI SAN.

The machine is very quite. I can only hear the HD’s access occasionally. The fan is near silent. The Mini really is one of the greatest computers Apple has ever designed/made. Other than the dumb single RAM slot the PPC mini’s had, they all have been great machines. I still have a 1st Generation Mac Mini running strong (1.25ghz G4, 1GB RAM, single 80GB HD, 10.5.8 client) at work (it runs Intermapper to monitor various devices around the building. Works great).

Verdict: 9.0/10. Only changes would be the second gig-E port, and it would be sweet if you could buy without the OS (if this was for work, I wouldn’t need even MORE copies of 10.6 (already have spares)). I’d give it a full 10, but I can’t think of anything that’s perfect. =)

If you have any questions, please feel free to leave a comment.

*Image lifted from Apple website.

PHP 5.3.1 compiled from source on 10.6.2 Server

February 3rd, 2010 staze 5 comments

Apple unfortunately forgot to include freetype support in GD with their stock version of PHP 5.3.0 in 10.6 Server at least up to 10.6.2.

So, there’s some info online about compiling freetype into GD in 10.6, but it doesn’t specifically address 10.6 Server, and it references downloading the PHP 5.3.0 source from Apple’s servers, rather than directly from php.net.

So, here’s the info.

  1. Create a directory for the src.
    sudo mkdir /src
  2. Chown that over to yourself.
    sudo chown username /src
  3. Change into that directory.
    cd /src
  4. Create pcre directory.
    mkdir pcre
  5. Change into pcre directory.
    cd pcre
  6. Download pcre source.
    curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gz -O
  7. Download php5.3.1 source.
    curl http://us3.php.net/distributions/php-5.3.1.tar.gz -O
  8. Download libjpeg-v7 source.
    curl http://www.ijg.org/files/jpegsrc.v7.tar.gz -O
  9. Untar all of the above.
    find *.tar.gz -exec tar xfvz {} \;
  10. Change into pcre source directory.
    cd pcre-8.01
  11. configure pcre.
    ./configure --disable-shared --enable-static
  12. Make, and install pcre.
    make && make install DESTDIR=/src/pcre/pcre-local
  13. Change into the jpeg directory.
    cd ../../jpeg-7
  14. Copy some config files into the current directory.
    cp /usr/share/libtool/config/config.sub .; cp /usr/share/libtool/config/config.guess .
  15. Config libjpeg.
    export MACOSX_DEPLOYMENT_TARGET=10.6
    CFLAGS="-arch x86_64" \
    CXXFLAGS="-arch x86_64" \
    LDFLAGS="-arch x86_64" \
    ./configure --enable-shared
  16. Make, and Make install.
    make; sudo make install
  17. Change directory into PHP source folder.
    cd ../php-5.3.1
  18. Modify line 186 of ./ext/iconv/iconv.c and change #define iconv libiconv to #define iconv iconv
  19. Configure PHP.
    MACOSX_DEPLOYMENT_TARGET=10.6
    CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp"
    CCFLAGS="-arch x86_64 -g -Os -pipe"
    CXXFLAGS="-arch x86_64 -g -Os -pipe"
    LDFLAGS="-arch x86_64 -bind_at_load"
    export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
    ./configure --prefix=/usr \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --disable-dependency-tracking \
    --sysconfdir=/private/etc \
    --with-apxs2=/usr/sbin/apxs \
    --enable-cli \
    --with-config-file-path=/etc \
    --with-libxml-dir=/usr \
    --with-openssl=/usr \
    --with-kerberos=/usr \
    --with-zlib=/usr \
    --enable-bcmath \
    --with-bz2=/usr \
    --enable-calendar \
    --with-curl=/usr \
    --enable-exif \
    --enable-ftp \
    --with-gd \
    --with-jpeg-dir=/usr/local/lib \
    --with-png-dir=/usr/X11R6 \
    --with-freetype-dir=/usr/X11R6 \
    --with-xpm-dir=/usr/X11R6 \
    --with-ldap=/usr \
    --with-ldap-sasl=/usr \
    --enable-mbstring \
    --enable-mbregex \
    --with-mysql=mysqlnd \
    --with-mysqli=mysqlnd \
    --with-pdo-mysql=mysqlnd \
    --with-mysql-sock=/var/mysql/mysql.sock \
    --with-iodbc=/usr \
    --enable-shmop \
    --with-snmp=/usr \
    --enable-soap \
    --enable-sockets \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --with-xmlrpc \
    --with-iconv-dir=/usr \
    --with-xsl=/usr \
    --with-pcre-regex=/src/pcre/pcre-local/usr/local
  20. Make PHP.
    export EXTRA_CFLAGS="-lresolv"; make
  21. Backup your php.ini
    sudo cp /private/etc/php.ini /private/etc/php.ini.bak
  22. Install new PHP
    sudo make install
  23. Restore php.ini, and restart apache.
    sudo cp /private/etc/php.ini.bak /private/etc/php.ini; sudo apachectl graceful

All and all, on a new mac mini server, this took about 20-30 minutes. And I now have a working PHP 5.3.1 install, and freetype now works with GD (allowing me to put the captcha back on my contact form under “About”. Good luck!

Reference Links: