Wednesday, April 17, 2013

Microsoft and Apple - Still Not Quite Playing Nice

Apparently, it's a known issue that in Mac OS X Server 10.6+ environments (such as my new 10.8 setup), clients that attempt to send mail with MS Outlook may encounter some... difficulties. Specifically, an undeliverable message will appear like the following:
That is, "Helo command rejected: need fully-qualified hostname

Unlike a number of the various trials that this upgrade has sent my way over the last 48 hours or so, this one is at least fairly simple to fix. According to Apple's Support website (which is surprisingly helpful here), on a 10.8 Mountain Lion Server, the following procedure is appropriate:

  1. In /Library/Server/Mail/Config/postfix/main.cf, locate the smtpd_helo_restrictions setting.
  2. Remove "reject_non_fqdn_helo_hostname" from the list of settings.
  3. Restart the Mail service.

And then for 10.6-10.7 Server:

  1. In /etc/postfix/main.cf, locate the smtpd_helo_restrictions setting.
  2. Remove "reject_non_fqdn_helo_hostname" from the list of settings.
  3. Restart the Mail service.
I post this here because this provides an important clue to those who may find themselves scratching their heads and unable to find good information when attempting to find where Apple has hidden the various configuration files veteran server admins are used to hand editing. Between 10.7 and 10.8 the postfix configuration folder has moved from /etc to /Library/Server/mail. A cursory inspection reveals that within /Library/Server/Mail/Config mail related services including amavisd, clamav, dovecot, postfix and spamassassin all store their configurations here. Backing out to /Library/Server reveals the rest of the services provided by Mac OS X Server, like Web, FTP and the built-in PostgreSQL database engine (but not MySQL, which does not come preloaded with Mac OS X Server).

Now, I'm not entirely sure what I think about moving configuration files that have long been stored in other places. While it is nice that this brings some degree of standardization, experienced server admins may find the transitions difficult. Beyond that, it is somewhat nice to be able to easily browse to all the configuration folders without having to issue the "got to folder" command within Finder. Those who prefer to administer from the command line likely won't see that as an advantage, however.

Monday, April 15, 2013

Upgrading PHP5 on Mac OS X Server 10.5.8 - Error establishing database connection

I was greeted by the above error message this evening after the long task of installing dependencies and upgrading the installation of PHP5 on my Mac server to get some needed extra features (like the GD library). After the successful installation of the latest PHP5 for Mac OS X 10.5.8 (Leopard) I could no longer access any of the Wordpress sites installed on my server. A closer look revealed the specific error when attempting to load a site was "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

Evidently the new installation is looking in a different location for mysql.sock (in my case it was in /private/var/mysql/mysql.sock). The fix was relatively simple, create a symlink from where the file exists, to where it is expected to be:

First, find it:

locate mysql | grep sock

Mine:

/private/var/mysql/mysql.sock

Symlink it:

ln -s /the/path/to/mysql.sock /tmp/mysql.sock

Wala, done. What could have been a multi-hour-tear-my-hair-out-and-probably-end-up-rebuilding-the-whole-server issue was resolved quickly and elegantly, without the need of modifying any global parameters in any config files which may break the next time the software is updated, etc.

Now the image processing bits of a Wordpress plugin my wife was wanting for her blog are functional and life is once again good.