the itjerk

my adventures with technology

Tag Archives: iredmail

the big upgrade

Production website upgrades (do-release-upgrade from 14.04.5 to 16.04.4) are the most nerve-wracking ever. Being a “one-man show” means it’s all or nothing, no team to lean on, just my wits and google. Sure, I had a back-up if everything went south; yes, I had an idea everything would work; and yes, I ran into problems.

The local copy of my website needed an earlier version of php to work. That fix was easy enough, I just installed ondrej ppa for it. But I ran into a problem with the production site because I have iRedMail installed; so yes, the local copy isn’t completely like the production site. Here the problem was auth_mysql, as evidenced by sudo apache2ctl configtest. Two mods I have – awstats and cluebringer – were calling auth_mysql and preventing apache2 to load. The fix was fairly easy, apt-get install libaprutil1-dbd-mysql, and then clearing out the offending *.conf files. Thanks to iRedMail for information.

Seeing that website, email, etc live again was a good, good feeling.

A few weeks later, there were a few more things I had to tweak to get oh-so-right, but most of that was email related, and mostly non-OS related.

Ubuntu LTS the only way to go

When I first configured my cloud server, I was under the impression that I would just be trying it out, a test environment. It didn’t occur to me that I’d actually put it in production. Flippantly, I chose 12.10 instead of opting for 12.04 LTS, which is supported through May 2017. Well, 13.04 was already out of service by the time I got my notice that 12.10 was end-of-life, so the upgrade path was 12.10 -> 13.10 -> 14.04 LTS. Good news is that was easy enough to do. Bad news was 13.10 broke Apache’s Auth_MYSQL, which is used with AWSTATS in iRedMail. 

Like a good itjerk, I didn’t panic, went straight from 13.10 to 14.04 LTS, and would worry about the mess from there. Ends up that Auth_MYSQL isn’t supported in Apache 2.4.x, which is what 14.04LTS ships with. So I had to switch to Auth_DBD instead. Zhang at iRedMail was very helpful, and I got everything back up and working. BTW, Denyhosts is no longer supported in 14.04 LTS, that package had to be purged.

Apache2.conf needs this:

DBDriver mysql
DBDParams "host=127.0.0.1 port=3306 dbname=mail user=mail pass=xxxx

While awstats.conf needs:

AuthType Basic
AuthName "Authentication required"
AuthBasicProvider dbd
AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username=%s"
Require valid-user

Then, do this:
a2enmod auth_dbd
apt-get install libaprutil1-dbd-mysql
service apache restart

Moral of the story: Use LTS. Always.