Archive for March, 2013

Ok, not really importance of having it configured, but at least a post to try and get myself to remember to do it.

I discovered that the Dreamhost server I’m hosting this blog on has bad clock drift. I’m not sure why it’s happening (I’d imagine that it should be one of the first things configured in a mass server environment, but hey…)

Anyway, having a ~5 minute clock drift broke the WordPress Google Authentication plugin – and anything else that’d rely on time. So I decided to quickly check my VPSes and just make sure they had ntpd up and running.

And oddly enough, the Xen instances didn’t, the ones where ntpd is the most necessary since it maintains an internal clock state disassociated from the wall clock. OpenVZ at least (appears to) inherit from the the container host, and both hosts I’m with appear to have ntpd enabled (or at least my clocks that are pretty close to the ntp.org pool time.

There was one extra thing necessary to do: change in the index_page variable in bonfire/application/config/config.php. This was probably a result of my testing to try and get things working, but I had “index.php” in it, so all the generated pages had index.php/ prepended to the internal links.

Hat tip to http://ericlbarnes.com/posts/codeigniter-nginx-virtual-host/ for a good starting point

Getting PHP-FPM sessions working

The default path, /var/lib/php/sessions is – by default – owned by root, and group apache, so the nginx user can’t write to it. So we have to change the folder owner and group:

chgrp nginx /var/lib/php
mkdir /var/lib/php/session

Alternatively, create a new directory in /tmp, something like /tmp/php-fpm, and make php-fpm the owner of that, and point php-fpm at that directory. (It would also prevent yum ever mucking with permissions on the folder, something which I’m not sure if it was just my imagination, or actually happened…)