-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement apache mod_maxminddb and peeringdb.com API
- Loading branch information
1 parent
3cb3341
commit 1f2728b
Showing
6 changed files
with
211 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
```bash | ||
apt install git apache2-dev build-essential libmaxminddb-dev | ||
cd /usr/local/src/ | ||
git clone https://github.com/maxmind/mod_maxminddb.git | ||
cd mod_maxminddb | ||
./bootstrap | ||
./configure | ||
make | ||
make install | ||
``` | ||
|
||
```bash | ||
/etc/apache2/mods-enabled/maxminddb.conf: | ||
|
||
MaxMindDBEnable On | ||
MaxMindDBFile MM_COUNTRY_DB /usr/local/share/maxminddb/GeoLite2-Country.mmdb | ||
MaxMindDBFile MM_CITY_DB /usr/local/share/maxminddb/GeoLite2-City.mmdb | ||
MaxMindDBFile MM_ASN_DB /usr/local/share/maxminddb/GeoLite2-ASN.mmdb | ||
|
||
|
||
MaxMindDBEnv MM_COUNTRY_CODE_COUNTRY_DB MM_COUNTRY_DB/country/iso_code | ||
MaxMindDBNetworkEnv MM_COUNTRY_DB MM_COUNTRY_NETWORK | ||
|
||
|
||
MaxMindDBEnv MM_COUNTRY_CODE_CITY_DB MM_CITY_DB/country/iso_code | ||
MaxMindDBEnv MM_COUNTRY_NAME MM_CITY_DB/country/names/de | ||
MaxMindDBEnv MM_CITY_NAME MM_CITY_DB/city/names/de | ||
MaxMindDBEnv MM_REGION_CODE MM_CITY_DB/subdivisions/0/iso_code | ||
MaxMindDBEnv MM_LONGITUDE MM_CITY_DB/location/longitude | ||
MaxMindDBEnv MM_LATITUDE MM_CITY_DB/location/latitude | ||
MaxMindDBNetworkEnv MM_CITY_DB MM_CITY_DB_NETWORK | ||
|
||
|
||
MaxMindDBEnv MM_ASN MM_ASN_DB/autonomous_system_number | ||
MaxMindDBEnv MM_AS_ORG MM_ASN_DB/autonomous_system_organization | ||
MaxMindDBNetworkEnv MM_ASN_DB MM_ASN_DB_NETWORK | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
print('<pre>'); | ||
|
||
print("\n\nMM_COUNTRY_CODE_COUNTRY_DB:\n"); | ||
print_r(getenv('MM_COUNTRY_CODE_COUNTRY_DB')); | ||
|
||
print("\n\nMM_COUNTRY_NETWORK:\n"); | ||
print_r(getenv('MM_COUNTRY_NETWORK')); | ||
|
||
print("\n\n\n"); | ||
|
||
print("\n\nMM_COUNTRY_CODE_CITY_DB:\n"); | ||
print_r(getenv('MM_COUNTRY_CODE_CITY_DB')); | ||
|
||
print("\n\nMM_COUNTRY_NAME:\n"); | ||
print_r(getenv('MM_COUNTRY_NAME')); | ||
|
||
print("\n\nMM_CITY_NAME:\n"); | ||
print_r(getenv('MM_CITY_NAME')); | ||
|
||
print("\n\nMM_LONGITUDE:\n"); | ||
print_r(getenv('MM_LONGITUDE')); | ||
|
||
print("\n\nMM_LATITUDE:\n"); | ||
print_r(getenv('MM_LATITUDE')); | ||
|
||
print("\n\nMM_CITY_DB_NETWORK:\n"); | ||
print_r(getenv('MM_CITY_DB_NETWORK')); | ||
|
||
print("\n\n\n"); | ||
|
||
print("\n\nMM_ASN:\n"); | ||
print_r(getenv('MM_ASN')); | ||
|
||
print("\n\nMM_AS_ORG:\n"); | ||
print_r(getenv('MM_AS_ORG')); | ||
|
||
print("\n\nMM_ASN_DB_NETWORK:\n"); | ||
print_r(getenv('MM_ASN_DB_NETWORK')); | ||
|
||
print("\n\n\n"); | ||
|
||
print("\n\nMM_REGION_CODE:\n"); | ||
print_r(getenv('MM_REGION_CODE')); | ||
|
||
print('</pre>'); | ||
?> |