在CentOS 5/RedHat Enterprise 5.3上编译安装GeoIP
来源:互联网 发布:通过网络传大文件 编辑:程序博客网 时间:2024/05/14 16:55
GeoIP install Manual on CentOS/RedHat Enterprise
1)Install the base GeoIP and related libraries:
yum install GeoIP GeoIP-devel GeoIP-data
2)Install the necessary stuff to install the module with APXS:
yum install httpd-devel apr-devel
3)Download the mod_geoip source, and untar it:
wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
tar -xzvf mod_geoip2_1.2.5.tar.gz -C /usr/local/mod_geoip2_1.2.5
tar -xzvf GeoIP-1.4.6.tar.gz -C /usr/local/GeoIP-1.4.6
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
tar -xzvf mod_geoip2_1.2.5.tar.gz -C /usr/local/mod_geoip2_1.2.5
tar -xzvf GeoIP-1.4.6.tar.gz -C /usr/local/GeoIP-1.4.6
4)Run the APXS install:
apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c /usr/local/mod_geoip2_1.2.5/mod_geoip.c
This will generate a mod_geoip.so in /etc/httpd/modules, and add a line to /etc/httpd/conf/httpd.conf:
This will generate a mod_geoip.so in /etc/httpd/modules, and add a line to /etc/httpd/conf/httpd.conf:
LoadModule geoip_module modules/mod_geoip.so
make sure the line 'LoadModule rewrite_module modules/mod_rewrite.so' line is uncommented.
5)modify /etc/httpd/conf/httpd.conf
#below lines place after the line: 'LoadModule rewrite_module modules/mod_rewrite.so' .
GeoIPEnable On
GeoIPDBFile /usr/local/GeoIP-1.4.6/data/GeoIP.dat
GeoIPDBFile /usr/local/GeoIP-1.4.6/data/GeoIP.dat
# below lines Must place in VirtualHost define if you had defined one Virtual Host in CentOS 5 / RedHat Enterprise 5.3.
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$
RewriteRule ^(.*)$ http://news.sina.com.cn$1 [L]
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$
RewriteRule ^(.*)$ http://news.sina.com.cn$1 [L]
6)restart Apache
- 在CentOS 5/RedHat Enterprise 5.3上编译安装GeoIP
- 在Redhat Enterprise linux 5上 安装Oracle10g Release 2
- 在RedHat Enterprise Linux5上安装MySQL
- freeswitch 在redhat 7.0/centos 7.0上的编译安装
- RedHat linux 5 enterprise上安装openJDK7
- 在centos和redhat上安装docker
- 在centos和redhat上安装docker
- 在centos和redhat上安装docker
- 在Linux CentOS上编译并安装Clang 3.5.0,适用于Redhat和Clang3.8
- RedHat Enterprise (Centos) kickstart 自动安装Linux
- 在RedHat Enterprise Linux 5上配置KVM网络
- 在 redhat 上编译
- 利用jdk.tar.gz部署在CentOS/RedHat Enterprise Linux上
- Redhat Linux Enterprise 4 上安装 oracle9i
- RedHat Enterprise Linux5 上安装vsftp
- RedHat Enterprise Linux5 上安装vsftp
- Redhat Enterprise linux 上安装Oracle10g
- 在Redhat Enterprise Linux 5.3下安装Oracle10g Release2
- 斐波那契数列
- SquirrelMail 汉化
- stm32下的时钟
- 开源通讯类C++库
- Informix 数据分页SQL
- 在CentOS 5/RedHat Enterprise 5.3上编译安装GeoIP
- unique_copy算法
- 开源GUI库——QT
- PIXELFORMATDESCRIPTOR的结构
- Web应用服务器推送技术Comet
- 新站提高网站粘度之我见(转来的)
- 电脑应用技巧:常用快捷键篇
- 基于Symbian OS的本地化技术研究
- 一位软件工程师的6年总结