# mod_maxminddb.so **Repository Path**: typeface-cn/mod_maxminddb.so ## Basic Information - **Project Name**: mod_maxminddb.so - **Description**: Windows 平台上 Apache 上用的 mod_maxminddb.so, 用于按IP国家控制访问。和 GeoIP 差不多。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-25 - **Last Updated**: 2024-10-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mod_maxminddb.so #### 介绍 Windows 平台上 Apache 上用的 mod_maxminddb.so #### 安装教程 1. 将对应版本的模块文件 mod_maxminddb.so 文件放到 Apache24/modules/mod_maxminddb.so 2. 将数据库文件 GeoLite2-Country.mmdb 放到 Apache 能访问的位置(比如 d:/db/GeoLite2-Country.mmdb)。 3. 修改 httpd.conf 文件 ``` # 加入模块 LoadModule maxminddb_module modules/mod_maxminddb.so # 配置 MaxMindDBEnable On # 下一行写 GeoLite2-Country.mmdb 的真实地址 MaxMindDBFile COUNTRY_DB d:/db/GeoLite2-Country.mmdb MaxMindDBEnv MM_COUNTRY_CODE COUNTRY_DB/country/iso_code MaxMindDBEnv MM_COUNTRY_NAME COUNTRY_DB/country/names/en ``` 4. 修改 httpd.conf 文件 ``` # 按IP国家禁止访问 SetEnvIf MM_COUNTRY_CODE ^(RU|US|UK) BlockCountry Require all granted Require not env BlockCountry ```