User Tools

Site Tools


linux:geoiplookup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:geoiplookup [2018/03/04 05:06] – created kbadminlinux:geoiplookup [2021/03/10 04:06] (current) kbadmin
Line 9: Line 9:
 </code> </code>
  
 +Bisa digunakan untuk mendeteksi ip dari negara tertentu dan mengahpusnya dari file. Contoh :
 +<code>
 +while read ip; do
 +  text=`geoiplookup $ip`
 +        if echo $text | grep -q 'Indonesia'; then
 +                sed -i "/$ip/d" /etc/csf/blacklistip.txt
 +                echo "$ip removed"
 +        fi
 +done < /etc/csf/blacklistip.txt
 +</code>
 +===== Update Geoip database dengan geoipupdate =====
 +Untuk mengupdate database geoip cukup jalankan perintah
 +<code>
 +geoipupdate -v
 +</code>
 +
 +Apabila terjadi kegagalan silahkan mendaftar disini https://www.maxmind.com/en/geolite2/signup
 +Kemudian buat keynya disini https://www.maxmind.com/en/accounts/current/license-key
 +
 +Setelah anda memiliki akses key, silahkan download file GeoIP.conf nya dan ubahlah konfigurasi GeoIP.conf di server anda.
 +
 +<code>
 +nano /etc/GeoIP.conf
 +</code>
 +ubah dan isi dengan GeoIP.conf yang anda telah dapatkan.
 +
 +Selanjutnya jalankan kembali geoipupdate

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/geoiplookup.1520158018.txt.gz · Last modified: 2018/03/04 05:06 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki