No APC on Yosemite


After upgrading to Yosemite it turns out APC is gone, and no longer installable. Yosemite comes with PHP5.5 for which there is no APC.
But the new PHP comes with opcache which you just have to enable by adding the following to your php.ini:
zend_extension=opcache omeprazole
On my site here it basically cut my page generation times in half straight out of the box. If you like some pretty graphics and an interface to manage it (and you run WordPress as well) grab the ‘OPcache Dashboard‘ plugin.

Mavericks Server

Finally took the plunge and upgraded to Mavericks, wasn’t sure how it’d go with the Server but I have to hand it to Apple, smoothest upgrade thus far.
After you upgrade the client to Mavericks you get a notice from the saying it needs updating. Download it from the App Store, launch it and it’ll automagically upgrade everything and after that everything was working as before. Nice.

So yeah, the only downside to the whole process is the name. Mavericks. Really?

Spam training in Mountain Lion Server


For some reason Spamassassin in Mountain Lion Server isn’t set up for scheduled spam/ham training, even though the hooks are there for it.
So you can a) configure that correctly and schedule it yourself or b) go for Spamtrainer, which works a lot smoother, automagically finds your spam and ham boxes and has enough options to run it as you please.
I really love the -i option which asks you a bunch of questions on how and when you want to run the training and then sets the schedule up for you.

Back from the dead

mountain lion server

The server is dead, long live the server. Well my trusty old Mac Mini decided to retire to the great beyond and kicked the bucket after 7 years. May it rust in peace. Unfortunately this meant my websites were down, as was my mail. The latter being slightly more important at the moment as I’m still looking for a job. Back in the previous decade I decided against getting the official OsX server software because back then it cost quite a lot (for home users anyway, dirt cheap compared to windows licensing) at $500 for 10 users and $1000 for unlimited users. Fast forward to 2013 and now it’s only $20 for unlimited users for Mountain Lion Server, so I decided to give it a try on my iMac to at least get a working mail server up. Which I did. Neat, and for less money than I’d previously paid for MailServe. Spamassassin, ClamAV, RBL, the works. Still some todo’s in that area, like setting up training for Spamassassin, but nice overall.
So I figured why stop there, let’s see what this puppy can do. Activated the web server, downloaded and installed MySQL which is not included, tweaked PHP a bit (apc is missing from the standard php setup, something I love to boost performance. I had to compile that from source to add it, I should make a follow up post for that) and here we are; back online and faster than before.
I’m sure there’s still a lot b0rked around the site, but so far so good.
Emphasis on the temporary solution as I still need a dedicated server for the lot but at least it’s all running for now.

Installing AMP on Mountain Lion

PHP5 on Snow Leopard

Using PHP5 under Mac OS X 10.6 (Snow Leopard) was a bit of a pain thusfar, because you’re limited to either using the built in PHP5 or building it from scratch. The latter being not for the faint of heart and the first not being ideal either. Although the built in PHP5 is a big improvement over the one supplied with 10.5, it still is lacking some rather standard and useful libraries. With 10.5 this was easily remedied by installing Entropy’s PHP5 package, but that hasn’t been updated for 10.6 and it doesn’t look like it will any time soon.
Luckily someone stepped in to fill the void and built his own using Entropy’s build scripts. So you sort of get the Entropy build, except it works.
So thank you very much Taracque, and for the rest of you; go download it here:

MailServe Snow

How good is it? Good enough to warrant the upgrade to Snow Leopard. That might be a bit of a bold statement but if, like me, you have a site that’s been online since the dark ages you’re undoubtedly bombarded with spam, in the thousands per day. MailServe Snow finally brings bayesian spam filtering to the table and it’s a sigh of relief. Combining the new spam filter options with an RBL like Spamhaus and my inbox finally feels calm again, for lack of better words. And I don’t need to keep open at all times to try and filter the junk out. It’s finally all taken care of server side, as it should.

How easy was it to upgrade from MailServe Pro for Leopard? Dead easy. Download, install. Launch the old one, save the config and select deinstall from the menu. Start the new one, load the config and you’re up and running.

I rarely rave about software, but if you have a Mac and want to use it as a mailserver you have to get this. I bought it for Tiger, for Leopard and for Snow Leopard and it’s by far the biggest bang for your buck you can get as you’ll have a fully fledged mailserver up and running in literally minutes.

Snow Leopard upgrade

Finally took the jump and upgraded both Macs from Leopard to Snow Leopard.
On the iMac, which is used as our every day computer, it couldn’t be more simple. Plop in the disk and go and at the end everything was upgraded and everything worked, we didn’t have a single app that was borked. Beautiful. And indeed, Snow Leopard is noticeably faster, which by itself is worth the upgrade.

The Mac Mini however… not so nice. Not really Apple’s fault but that one is used as my webserver/mailserver/database server/ftp server and after the upgrade…. well nothing worked. At all. It took me a good day to figure out every single little thing as some problems just didn’t make any sense whatsoever.
First and foremost, it’s a stupidly simple thing to fix once you’ve figured it out, but before you do it can take a while; if you see parts of your site failing without any proper error, with apache processes crashing left right and center (with messages in your Apache error log like “[notice] child pid 7362 exit signal Bus error (10)”), look for mysql_close() in your php scripts and remove it. Simple huh? Apparently it’s no longer supported in PHP 5.3 which is default in Snow Leopard and using mysql_close() makes your page halt wherever its called and the Apache process fall over and die a horrible death. This was during my upgrade the last glitch to fix, but it also took by far the most time to track down as I thought it was simply crapping out due to misconfiguration.
The rest was pretty simple, just make sure you make a backup of your Apache config files prior to upgrade as these get replaced, so you can easily get things like your vhost settings back. You may also have to recreate the symbolic link to mysql depending on which package you were using. As for my mail, that was simply a matter of buying the new MailServe Snow to replace the old Leopard Pro version.

So overall, yay for Snow Leopard. Just make sure you have a good backup if you’re using yours as a server as well.

Turning your Mac into a webserver

Here’s how to turn your Mac into a web/mail/ftp server with all the trimmings.
Apache is included and works just fine, just turn on web sharing in you preferences.
If you intend on hosting multiple sites, here’s a rundown on how to configure virtual hosts.
PHP comes included with Leopard but is disabled by default. You could enable it, however, it’s rather limited as a lot of extras aren’t included which can be rather useful on a webserver, such as GD support. It’s therefor better to download and install Entropy’s PHP package.
MySQL, just download and install the official build from here. I might make a followup post covering MySQL’s post install tasks such as setting the root password, creating users and databases from the command line.
Mail. By far the easiest and least hair pulling way to set up a full mailserver is by ploinking down $25 for MailServe Pro (or $15 for MailServe if you don’t care about Dovecot. I do because it’s faster and supports multilevel folder creation). You’ll have your mailserver up and running in under 5 minutes, well worth the money.
FTP, this can be useful if you use a different computer as your client machine, or if you want to allow other people access to your mac for their own sites. For this I use the excellent PureFTPd Manager.
And finally, seeing as you’ll undoubtedly be editing a lot of textfiles and the Mac’s TextEdit can mess them up, get TextWrangler for all your editing needs, it even integrates in your command line.

Work in progress... not home!
Trying to get all/most of the new code working before I start on the eyecandy.