Our daily ramblings about stuff

Scan Drupal installations for version number

In case you got multiple Drupal installations at your server and want to find out the current version of each:

for i in $(find -maxdepth 2 -name CHANGELOG.txt); do dirname $i; head -n 2 $i|grep Drupal ; done

Use "drush up" to update where needed.


move /tmp mount from disk to memory

When you got a heave load on your disk with many IO's and the /tmp mount is a primary target of that?
Here is a heroic solution. Move it from disk to memory.

It only requires a simple change in fstab. The configuration file that defines all your mounts.

The old /tmp config:
/dev/mapper/vg1-tmp /tmp ext4 defaults,nosuid,noatime,noexec 0 2

The new /tmp config:
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=10G 0 0


Apache config for high traffic websites

Set up a Apache config that takes the max out of your server abilities.
The only goal is to serve as much visitors as possible.
Other things, like server load or bandwidth usage are not taken into account.

First step:
Check if there are any AH00161 errors

sudo cat /var/log/apache2/error.log | grep MaxRequestWorkers;
sudo cat /var/log/apache2/error.log | grep ServerLimit;

Check the average process size for Apache: