Géolocalisation et Awstats : GeoIP
Installation des données
Commençons déjà par récupérer les sources :
cd /usr/src wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
créons un répertoire pour GeoIP :
mkdir /usr/local/share/geoIP cp GeoIP.dat.gz /usr/local/share/geoIP/ gunzip /usr/local/share/geoIP/GeoIP.dat.gz cp GeoLiteCity.dat.gz /usr/local/share/geoIP/ gunzip /usr/local/share/geoIP/GeoLiteCity.dat.gz cp GeoIPASNum.dat.gz /usr/local/share/geoIP/ gunzip /usr/local/share/geoIP/GeoIPASNum.dat.gz
Installation du programme GeoIP
Télécharger, décompresser et compiler GeoIP-*.tar.gz
cd /usr/src wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gz cd /usr/local tar -xvzf /usr/src/GeoIP-1.4.5.tar.gz mv GeoIP-1.4.5/ GeoIP cd GeoIP ./configure make make check make install
Il faut ensuite télécharger, décompresser et compiler Geo-IP-*.tar.gz
cd /usr/src wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.38.tar.gz cd /usr/local tar -xvzf /usr/src/Geo-IP-1.38.tar.gz mv Geo-IP-1.38 Geo-IP cd Geo-IP #Une fois téléchargé, on installe : perl Makefile.PL LIBS='-L/usr/local/lib' make make install
Mise à jour des fichiers de configuration AwstatsOuvrez vos fichiers de configuration awstats, et pour chaque site, ajoutez dedans :
Awstats a maintenant le plugin de géolocalistation !
Lire l'article lié :













cd /usr/src
wget http://....35.tar.gz
cd /usr/local
tar -xvzf /usr/src/Geo-IP-1.38.tar.gz
mv Geo-IP-1.38 Geo-IP
cd Geo-IP
#Une fois téléchargé, on installe :
perl Makefile.PL LIBS='-L/usr/local/lib'
make
make install
Or il faudrait faire :
cd /usr/src
wget http://....38.tar.gz
cd /usr/local
tar -xvzf /usr/src/Geo-IP-1.38.tar.gz
mv Geo-IP-1.38 Geo-IP
cd Geo-IP
#Une fois téléchargé, on installe :
perl Makefile.PL LIBS='-L/usr/local/lib'
make
make install
c'est au niveau du wget...
Merci pour ce petit tutoriel.
Cordialement,
sih.itinet.fr (en ligne a partir de la semaine prochaine)
Il m'a été trés utile.
J'ai remarqué cette erreur "tar -xvzf Geo-IP-1.35.tar.gz".
Il faudrait indiquer tar -xvzf "/usr/src/"Geo-IP-1.35.tar.gz
et je pense qu'il faut télécharger la version 1.38 car j'ai eu un souci avec la 1.35.
Il y à 2 petites erreurs.
La première ce trouve dans le deuxième encadré de code.
Il y à marqué : gunzip /usr/local/geoIP/share/GeoIP.dat.gz
au lieu de : gunzip /usr/local/share/geoIP/GeoIP.dat.gz
La deuxiéme ce trouve dans le quatriéme encadré.
Il y à marqué : mv Geo-IP-1.35.tar.gz Geo-IP
au lieu de : mv Geo-IP-1.35 Geo-IP
Sinon ça fonctionne bien :)