Ich habe alles nach dieser Anleitung gemacht, aber bissher keinen erfolgt gehabt.Zitat
root@i7-id2200:/home/hlx/GeoLiteCity# ./geoip.py
DOWNLOADING GEO DATA....
EXECUTING: date +%Y%m01
EXECUTING: rm *.csv > /dev/null
EXECUTING: wget http://www.maxmind.com/download/geoip/da…ty_20120301.zip
--2012-03-03 14:08:19-- http://www.maxmind.com/download/geoip/da…ty_20120301.zip
Auflösen des Hostnamen www.maxmind.com... 208.43.124.51
Verbindungsaufbau zu www.maxmind.com|208.43.124.51|:80... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 301 Moved Permanently
Platz: http://geolite.maxmind.com/download/geoi…ty_20120301.zip[folge]
--2012-03-03 14:08:19-- http://geolite.maxmind.com/download/geoi…ty_20120301.zip
Auflösen des Hostnamen geolite.maxmind.com... 174.36.207.186
Verbindungsaufbau zu geolite.maxmind.com|174.36.207.186|:80... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 404 Not Found
2012-03-03 14:08:20 FEHLER 404: Not Found.
EXECUTING: unzip -o GeoLiteCity_20120301.zip
unzip: cannot find or open GeoLiteCity_20120301.zip, GeoLiteCity_20120301.zip.zip or GeoLiteCity_20120301.zip.ZIP.
EXECUTING: mv GeoLiteCity_20120301/GeoLiteCity-Blocks.csv geoLiteCity_Blocks.csv
mv: Aufruf von stat für âGeoLiteCity_20120301/GeoLiteCity-Blocks.csvâ nicht möglich: Datei oder Verzeichnis nicht gefunden
EXECUTING: mv GeoLiteCity_20120301/GeoLiteCity-Location.csv geoLiteCity_Location.csv.temp
mv: Aufruf von stat für âGeoLiteCity_20120301/GeoLiteCity-Location.csvâ nicht möglich: Datei oder Verzeichnis nicht gefunden
EXECUTING: rmdir GeoLiteCity_20120301
rmdir: konnte âGeoLiteCity_20120301â nicht entfernen: Datei oder Verzeichnis nicht gefunden
EXECUTING: iconv -f ISO-8859-1 -t UTF-8 geoLiteCity_Location.csv.temp > geoLiteCity_Location.csv
iconv: Kann die Eingabedatei »geoLiteCity_Location.csv.temp« nicht öffnen: Datei oder Verzeichnis nicht gefunden
WRITING DATABASE FILE....
Traceback (most recent call last):
File "./geoip.py", line 195, in <module>
main()
File "./geoip.py", line 182, in main
if write_sql(sqlname):
File "./geoip.py", line 125, in write_sql
f = open("geoLiteCity_Blocks.csv")
IOError: [Errno 2] No such file or directory: 'geoLiteCity_Blocks.csv'
Benutzerinformationen überspringen
Administrator
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
def fetch_geodata(): """ Obtains the geoLiteCity raw data, resulting in geoLiteCity_Location.csv and geoLiteCity_Blocks.csv """ # database is updated on 1st every month, so download the file from the 1st of current month DAT = system("date +%Y%m01") FIL = "GeoLiteCity_%s"%DAT FILE = FIL + ".zip" system("rm *.csv > /dev/null") if not os.path.exists(FILE): system("wget http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/" + FILE) system("unzip -o " + FILE) system("mv %s/GeoLiteCity-Blocks.csv geoLiteCity_Blocks.csv"%FIL) system("mv %s/GeoLiteCity-Location.csv geoLiteCity_Location.csv.temp"%FIL) system("rmdir " + FIL) system("iconv -f ISO-8859-1 -t UTF-8 geoLiteCity_Location.csv.temp > geoLiteCity_Location.csv") return |
Quellcode |
|
1 2 3 4 5 6 7 8 9 |
def fetch_geodata(): """ Obtains the geoLiteCity raw data, resulting in geoLiteCity_Location.csv and geoLiteCity_Blocks.csv """ system("mv GeoLiteCity-Blocks.csv geoLiteCity_Blocks.csv") system("mv GeoLiteCity-Location.csv geoLiteCity_Location.csv.temp") system("iconv -f ISO-8859-1 -t UTF-8 geoLiteCity_Location.csv.temp > geoLiteCity_Location.csv") return |
Quellcode |
|
1 2 3 4 |
DBHOST="localhost" DBNAME="your_hlstats_db" DBUSER="your_sql_username" DBPASS="your_sql_password" |
Quellcode |
|
1 2 |
iconv mysql #Wenn die Datenbank lokal auf dem Host installiert ist, ist das Tool installiert |