A Redis object cache for WordPress

Written late at night in English • Tags: , , , ,

WordPress Site Health had been nagging me to use a persistent object cache. I already run Zend OpCache, so I wondered what else I needed.

OpCache is an opcode cache: it stores the compiled bytecode of the PHP source so the engine need not recompile it on every request. The object cache is a different layer, holding the results of database queries and transients. WordPress ships with a non-persistent object cache that lives only for the duration of a single request; making it persistent means backing it with something that survives across requests, such as Redis.

On this site I manage the WordPress tree with svn and do not let PHP write into it, which changes a couple of the steps from the usual click-in-the-dashboard instructions. While I also generally prefer nginx and PHP-FPM, this site is still on Apache with mod_php. However, the installation is basically the same regardless of the web server software, but troubleshooting differs between them. I’m covering both here. (more…)

Clean up legacy network interface naming

Written in the mid-afternoon in English • Tags: , , ,

Predictable network interface names are all the rage in Linux distros these days. My systems are of various vintage so most have carried on with eth0 and eth1 through upgrades by having old udev rules kept around.

To get with the times a few steps are needed: (more…)

»
Today I wanted to use phpMyAdmin for the first time in quite a while, only to see errors when viewing a table. Lucky for me, there was an easy fix. (more…)

Switch back to sysvinit

Written at lunch time in English • Tags: , , ,

If you have already upgraded to jessie and have systemd as init, you can switch back with these commands:

apt-get install -y sysvinit-core
reboot
apt-get purge -y systemd

Running with sysvinit works better on my servers, as daemons have a chance of doing their own graceful shutdown before the network is brought down.

Stay with sysvinit

Written at evening time in English • Tags: , , ,

Before upgrading to jessie, create /etc/apt/preferences.d/use-sysvinit:

Package: systemd-sysv
Pin: release o=Debian
Pin-Priority: -1

See also: How to stay with sysvinit in Debian Jessie by Petter Reinholdtsen

Missing sounds in Asterisk

Written late in the afternoon in English • Tags: , , ,

The latest odd fix for Asterisk after an upgrade (11.13.0~dfsg-1~bpo70+1):

cd /usr/share/asterisk/sounds && ln -s en_US_f_Allison en

I don’t know when this broke. I found out because calling voicemail would fail (due to a missing password prompt sound file).

Unbound not resolving

Written in the mid-morning in English • Tags: , , , ,

I’m not sure what failed last night, but I’m guessing the cable Internet connection was down. Interestingly, unbound had stopped resolving even local zones configured with stub-zone and stub-addr directives. This was unexpected: stub-zones are supposed to work “without referring to the public Internet” per the unbound.conf manual page.

To mitigate the issue I wanted to have backup name servers in resolv.conf (ones using a different Internet connection) even on the resolving name server hosts themselves. With resolvconf that boiled down to creating /etc/default/resolvconf with the following setting in it:

TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no

This way name servers configured in /etc/network/interfaces (using dns-nameservers directives) are included in resolv.conf even when unbound has been started.

However, this is a poor workaround, as I don’t have multiple Internet connections at every site.

Wheezy upgrades

Written late in the evening in English • Tags: , , , , , , ,

Debian 7.0 “wheezy” was officially released about a week ago. I’ve been running it on a couple of systems for a few months already because of the more recent software versions available on it. Today I upgraded one of the shell servers, a couple of days ahead of the originally posted schedule due to security updates to MySQL (DSA-2667). As usual for Debian, the upgrade process is well documented1 and robust. However, here are some notes for upgrading the next instance. (more…)

Asterisk installation

Written late in the afternoon in English • Tags: , , , ,

Just a short note on getting a minimal Asterisk environment installed on current versions of Debian and Ubuntu:

aptitude install asterisk
m-a a-i zaptel
modprobe ztdummy

Also add ztdummy to /etc/modules so it gets loaded when the system starts.

If the m-a command is not found, install the module-assistant package.

»
New installations of Debian have rsyslog as the system logging daemon. Upgraders, however, will be left with sysklogd — and no instructions on how to switch. I’m hoping purging the old one and adding the new one will work ok, as I’ve made no local mods to the logging configuration…