Tag: Help

HAProxy – HTTP 500s Out Of The Blue – Fixed

So this morning we faced a few interesting issues revolving around our HAProxy setup.

The scenario we faced was HAProxy reporting all our servers as down, despite them being perfectly accessible directly (i.e. not through the load balanced IP)

And thus the process of elimination began;

  • Firewall Issue – Nope
  • AV Upgrade – Nah
  • Changes in the web applications – Ney

I have to admit, we were pretty stumped. Our Icinga (Nagios fork) check_http checks were going through fine, when we duplicated checks to the servers they were also fine and reporting a normal 200 status.

Looking at the checks, it was reporting an issue with our mobile site (Currently in development) so we added in an agent-type to the HAProxy httpchk, still no dice.

After more prodding and poking and a big hint from vr (@vihaire) I added in a host header and as if by magic, the sun came out from behind the clouds and shone its delightful rays upon us.

The config used was the following;

So if you run into this issue, then this may just be the fix to your problems!

A nice little article on Host Headers and IIS @ http://www.it-notebook.org/iis/article/understanding_host_headers.htm

How to rename your Ubuntu 12.04 Server

So, you just screwed up the name of your Ubuntu server?

Well that can be changed in no time and with no downtime

Just follow the ermm following;

  • Set a new hostname
sudo hostname your.brand.new.host.name
  • Edit the /etc/hosts file

sudo vi /etc/hosts

  • Edit the /etc/hostname file

sudo vi/etc/hostname

In some circumstances, you may also have to change the /etc/resolv.conf file.

Simple, yes! But worth 90 seconds to write out ;P