Posts Tagged ‘Linux’

Quick guide to Linux daemons in PHP

Monday, July 6th, 2009

This guide was originally written for a PHPNW meetup – more information on the group is available here

Whenever we want to carry out lengthy tasks or process large batches of data, we should consider executing that process in the background. The most typical way of doing this is through “cron jobs” – tasks which are scheduled to be executed at regular intervals; every 2 minutes, or at 6am every Sunday. Alternatively, you can have the web browser instigate the task by using something like shell_exec(). This guide presents a third alternative, system level daemons.
(more…)

MySQL Replication over SSL

Friday, June 19th, 2009

A new project requires MySQL replication to be carried out over the internet. My first thought was to use stunnel, which I quickly implemented. This appeared to work perfectly (after some iptables configuration). However, I found out later that MySQL supports replication over SSL natively. I have made the assumption (perhaps mistakenly) that a native solution would be better (more reliable?) than a wrapped solution. Getting MySQL replicating over SSL was perhaps about 30 minutes work in total. This could’ve been cut down to about 10 minutes if it wasn’t for some documentation-related issues.
(more…)