From 9ca80565a4b8eed0ffd89eb8f6a76ea2dd8cfe04 Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Mon, 17 Dec 2018 15:55:58 +0100 Subject: [PATCH] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'GEOIP/readme'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GEOIP/readme | 93 +++------------------------------------------------- 1 file changed, 4 insertions(+), 89 deletions(-) diff --git a/GEOIP/readme b/GEOIP/readme index 8b52e8c..1604d3d 100644 --- a/GEOIP/readme +++ b/GEOIP/readme @@ -1,93 +1,8 @@ -Create a script file: update-geoip.sh - -and copy paste: - -#!/bin/bash -# updater-geoip.sh -# geoip-lite-update -- update geoip lite database(s). -# (c) 2008,2009,2010,2011,2012,2013,2014 poeml@cmdline.net -# Distribute under GPLv2 if it proves worthy. - -# With added support for: -# - GeoLiteCityv6 -# - GeoIPASNum -# - GeoIPASNumv6 -# by Ludovic Fauvet +How to make GEOIP runnin g on your server (debian + apache2) -for i in curl wget ftp; do - if which $i &>/dev/null; then - prg=$i - break - fi -done +Need to install some package first: -if [ -z "$prg" ]; then - echo cannot find a tool to download, like curl or wget >&2 - exit 1 -fi +```apt-get install -y geoip-bin geoip-database libgeoip-dev libgeoip1 libapache2-mod-geoip php-geoip``` -case $prg in -curl) - prg="curl -s -O" - ;; -wget) - prg="wget --quiet" - ;; -esac - - -set -e - -# GeoIP data used to be in /usr/share/GeoIP in the openSUSE package, and was moved later. -# try the old location first - if it's present, it means that the user had his own -# updated database there -cd /usr/share/GeoIP/ 2>/dev/null || cd /var/lib/GeoIP - -rm -f GeoIP.dat.gz -$prg http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz -gunzip -c GeoIP.dat.gz > GeoIP.dat.updated.new -mv GeoIP.dat.updated.new GeoIP.dat - -rm -f GeoLiteCity.dat.gz -$prg http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -gunzip -c GeoLiteCity.dat.gz > GeoLiteCity.dat.updated.new -mv GeoLiteCity.dat.updated.new GeoLiteCity.dat - -rm -f GeoLiteCityv6.dat.gz -$prg http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz -gunzip -c GeoLiteCityv6.dat.gz > GeoLiteCityv6.dat.updated.new -mv GeoLiteCityv6.dat.updated.new GeoLiteCityv6.dat - -rm -f GeoIPv6.dat.gz -$prg http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz -gunzip -c GeoIPv6.dat.gz > GeoIPv6.dat.updated.new -mv GeoIPv6.dat.updated.new GeoIPv6.dat - -rm -f GeoIPASNum.dat.gz -$prg http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz -gunzip -c GeoIPASNum.dat.gz > GeoIPASNum.dat.updated.new -mv GeoIPASNum.dat.updated.new GeoIPASNum.dat - -rm -f GeoIPASNumv6.dat.gz -$prg http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz -gunzip -c GeoIPASNumv6.dat.gz > GeoIPASNumv6.dat.updated.new -mv GeoIPASNumv6.dat.updated.new GeoIPASNumv6.dat - - - -set +e - -if [ "$1" = "--no-reload" ]; then - exit 0 -fi - -if [ -x /etc/init.d/apache2 ]; then - /etc/init.d/apache2 reload -elif [ -x /etc/init.d/httpd ]; then - /etc/init.d/httpd reload -elif [ -x /usr/bin/systemctl ]; then - /usr/bin/systemctl reload httpd >/dev/null 2>&1 || : -elif [ -x /bin/systemctl ]; then - /bin/systemctl reload httpd >/dev/null 2>&1 || : -fi +And Copy ths updater-script: updater-geoip.sh \ No newline at end of file