For a minute there, I thought that my changes had fixed the wireless link. But no. The reason the server connection stayed active all night was because it was getting pinged by a load of MT comment spamming. When that stopped, the server timed out again. I've gone back to the old method of pinging the router from the server via and SSH connection.
I wish I knew more Linux stuff.