Fear and Loathing on the Learning Curve: Observations on Life, Tech and Web Design from a Slightly Misanthropic Mind

Fix Debian Exim4 Broken By Upgrade

Thought I’d just post this since I didn’t find an author­it­at­ive answer on the web. Those using exim4 on a Debian test­ing or unstable sys­tem might recently have found their sys­tem broken after doing a dist-upgrade to ver­sion 4.67−7, with exim4-config fail­ing to con­fig­ure with a mes­sage sim­ilar to the following:

Exim con­fig­ur­a­tion error in line 28 of /var/lib/exim4/config.autogenerated.tmp: mal­formed macro definition.

Continued →

3

Solving Slow Apache/PHP; Culprit = ClamAV

I’ve been hav­ing a lot of prob­lems recently with my home Debian server lock­ing up, with Apache pro­cesses swell­ing up until all RAM is eaten up and CPU 100% util­ised. The box stops respond­ing until I can get local access and restart Apache. This used to hap­pen sev­eral times a week, des­pite actual load on the server being very low with hardly any web requests.

I put this down to the age of the install and some dodgy Apache set­tings and didn’t look too much into fix­ing it; I turned the child pro­cess set­tings down a lot which didn’t improve things, so I just set a cron job up to restart apache every so often. It was only when I came to install Debian on a brand-new server at work that I real­ised some­thing was afoot — the Apache/PHP install on this new server was doing the same thing — lock­ing up sev­eral times a day for no appar­ent reason and in the exact same way. Both serv­ers would sud­denly exper­i­ence massive CPU and RAM util­isa­tion; addi­tion­ally Apache would take sev­eral minutes to get from star­tup to actu­ally accept­ing requests, with huge CPU use in that time. Incidentally, my home box is testing/unstable and this new server is Etch (stable).

I spent a few minutes going through the con­fig files for Apache, PHP and MySQL (also installed on my home box) in an effort to optim­ise the install, and examined the exten­sions list in php.ini to see if there were any I could remove. I unfor­tu­nately suf­fer from over-enthusiasm when installing things like PHP, XMMS and so on, whereby I read the list of related pack­ages and install everything that I might pos­sibly need someday or that could be use­ful at some point. In this case this included php4-clamavlib, which I installed think­ing it might be good to play with on a rainy day.

A quick apt-get remove php4-clamavlib and I restar­ted Apache; to my sur­prise it came up in about two seconds as opposed to the three minutes it was tak­ing before to stop using 100% CPU after being star­ted. I watched the box care­fully for the rest of the day and it had no prob­lems. Upon get­ting home I did the same thing on my own server and it too appears to be cured. So if you’re hav­ing prob­lems with Apache sud­denly chok­ing, check to see if you’ve got the ClamAV lib­rary for PHP installed. If you don’t need it, lose it!

Posted August 2nd, 2007

You can find a complete history of older posts in the Archive.