Changes

From SME Server
Jump to navigationJump to search
700 bytes added ,  11:24, 11 October 2010
→‎GeoIP database: Added cron-job to refresh GeoIP database
Line 27: Line 27:     
  gunzip GeoIP.dat.gz
 
  gunzip GeoIP.dat.gz
 +
 +
==== Creating a cron-job ====
 +
 +
We can add a cron-job to automate the monthly process of updating the GeoIP database:
 +
  mkdir -p /etc/e-smith/templates-custom/etc/crontab
 +
 +
Now we will add a custom template fragment:
 +
  vim /etc/e-smith/templates-custom/etc/crontab/91_Update_GeoIP_db
 +
 +
Add the following to this fragment, this will download and extract the new database every month:
 +
  # Updating the GeoIP database monthly on the 5th at 0:00h.
 +
  0 0 5 * * root /usr/bin/wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz -O /var/lib/GeoIP/GeoIP.dat.gz; /bin/gunzip -f /var/lib/GeoIP/GeoIP.dat.gz
 +
To activate the custom template fragment:
 +
  expand-template /etc/crontab
    
=== GeoIP qpstmpd plugin ===
 
=== GeoIP qpstmpd plugin ===
167

edits

Navigation menu