Configure OpenX Maintenance Scripts on SliceHost

Setup:

  • SliceHost 1gb RAM Xen VPS x86_64
  • CentOS 5.2
  • MySQL 5.0.45
  • PHP 5.1.6 (cli)
  • Apache 2.2.3
  • OpenX 2.6.3

Unless you love vi, set your environment’s EDITOR first. For me, this is the most important part of the process. I hear the cool kids use nano these days. I work at MIT so I feel like I have to use Emacs. 

edit ~/.bash_profile and add these lines
EDITOR=/usr/bin/emacs
export EDITOR

Then edit your crontab file and add a line like this to it:
crontab -e
30 10 * * * /usr/bin/php /var/www/i.mitsmr.com/openx/scripts/maintenance/maintenance.php i.mitsmr.com

That will run the maintenance script once per day at 10:30pm. Check your crontab log for any errors:
sudo tail /var/log/crontab

Oh, and OpenX pushed 2.6.4 update out yesterday. Take one thing off the todo-list, add something new right back on! Sheesh.

CentOS 5.2 Yum Automatic Updates

Took a little hunting around to find this out (I haven’t been using yum very long), perhaps it will help someone in the future.

  1. Update everything: yum update
  2. Install yum-cron. This is an alternative to yum-updatesd, a daemon that looked like people were having problems with and were not recommending for servers. yum install yum-cron.
  3. yum-cron isn’t a daemon, its a way of getting some daily weekly cron scripts installed on the server so that yum updates once per day and cleans up once per week. When you do a chkconfig –list you’ll see that yum-cron is in the list and is off for all run-levels, not sure if that’s important or not since once its installed, cron and the cron scripts should work fine on reboot (as long as crond is on). I turned yum-cron on any way chkconfig yum-cron on.
  4. That’s it. Now yum should check for updates each night and install any thing its found.