Dynamic backend servers with Varnish 3.0

Note: This only works in Varnish 3 – Varnish 4 removed the DNS director and we’ll have to wait on a VMOD or make one ourselves to get this working in version 4! Let’s say you’re wanting to host multiple websites on multiple backend servers and you want a single caching reverse proxy in front of all of them to make them super speedy. For example each of my sites lives in its own OpenVZ container for security purposes as well as super easy backups and restores if needed.

Webserver down: "Invalid command ‘php_value’"

Well this one took me by surprise I’ll say. It’s never fun when Zabbix lights up saying half of your websites have dropped out! Starting httpd: Syntax error on line 31 of /etc/httpd/conf.d/php.conf: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration [FAILED] Firstly DO NOT comment out the bottom two lines as some sites have recommended. The reason being this will allow your webserver to start up however PHP will not be processed, dumping all of your site’s code into the browser as plain text for anyone to see!

A fix for my Windows 8 laptop dropping wifi connection

Plagued by the constant disconnecting from the wifi whenever I wandered off for a few moments to do something in meatspace I had to find out what was going on. Then I procrastinated.. and completely forgot about it. Then it did it again so I started searching. Piecing together giblets of information from the internet I figured out Windows 8 likes to switch off power to the wifi adapter if the computer goes idle for long enough.

Install git from source on Centos 6

Just want the latest version of git but CentOS 6 doesn’t provide it using yum? Personally I needed this to install the completely awesome GitList Quick note – If you’re here because you need to just install git you probably just want yum install git! Before you start on this you should probably know that this will likely interfere with yum if you ever try installing git with yum or rpm.

Redirect / Rewrite destination IP address using iptables

Just a quick one on how to alter the destination of an outbound connection IP using iptables. I imagine a few tweaks would allow this to work in the sense of redirecting through a proxy etc too.