IT Dribble

Mutterings, inconsistant tips, rants and randomness

Samhain - POLICY NODIRECTORY explained

by

This was a tricky one. I kept getting alerts for:

-----BEGIN MESSAGE-----
[2012-07-09T23:40:37+1000] server8.somedomain.com
CRIT   :  [2012-07-09T23:40:34+1000] msg=<POLICY NODIRECTORY>, path=</var/log>
-----BEGIN SIGNATURE-----
EA6AB852FD5E03118A95B8507E514F264CCFE3CC35E3330F
000154 1340761939::server8.somedomain.com
-----END MESSAGE-----

And for the life of me wasn’t sure why but after reading the source code the cause is explained:

{ MSG_FI_NODIR, N_("File found where directory was expected"), IDMEF_IMPACT_TYPE_FILE },

And you know what it was correct! /var/log was a softlink to /data/logs!

Performance Tuning WordPress for Low Spec Servers

by

I recently moved my website to a cheap VPS I had the fun journey of trying to get it work without grinding to a halt everytime I clicked on a page, which you ‘should’ have noticed is fixed.

Firstly I needed to be realistic this blog wouldn’t have more than two simultanious connections at once, with that known I could then edit the amount for apache server threads to an un-godly small number in /etc/apache2/apache2.conf


StartServers 2
MinSpareServers 2
MaxSpareServers 2
MaxClients 20
MaxRequestsPerChild 0

With that noted a quick look at ‘top’ shows MySQL eating lots of Virtual Memory a quick swap of the configuration file: /usr/share/doc/mysql-server-5.1/examples/my-small.cnf to /etc/mysql/my.cnf sorts out that problem. (Don’t forget to backup your originals)

And finally modifying the WordPress max memory limit as noted in this post
suhosin[10882]: ALERT – script tried to increase memory_limit to 268435456 bytes