Aller au contenu Aller au menu Aller au sous menu Aller à la recherche

Ligams » Publications » Linux » Géolocalisation et Awstats : GeoIP

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é :

Installation de Awstats

Commentaires

eratum

Samedi 05 Décembre 2009 16:30:02 - chris

bonjour je vien de voir pour Geo-IP ceci :

cd /usr/src
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.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://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

c'est au niveau du wget...

Merci pour ce petit tutoriel.

Cordialement,
sih.itinet.fr (en ligne a partir de la semaine prochaine)

Merci

Mercredi 26 Août 2009 14:20:59 - Stéphane

Merci Patrice, j'ai corrigé ces erreurs :)

Géolocalisation et Awstats : GeoIP

Mercredi 26 Août 2009 12:15:02 - Patrice

D'abord, merci pour ce tutoriel;
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.

Merci

Vendredi 21 Août 2009 12:00:02 - Stéphane

Merci pour votre remarque, c'est corrigé !

Erreurs

Vendredi 21 Août 2009 11:54:11 - Lefoudupc

Bonjour,

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 :)

Les commentaires sont tous validés par un modérateur, votre commentaire n'apparaît pas directement sur le site.
Aucun support n'est assuré ici, vous pouvez néanmoins laisser vos remarques et critiques sur l'article, les points de vue pertinents sont toujours les bienvenus.

Votez pour cet article

Vote: 4,00/5
(Nombre de votant(s) : 1)

Traduction automatique

Recherche

Ligams © 2009 tous droits réservés - Contact | Aide à la navigation | Plan du site | Glossaire | Infos légales | Accessibilité