• 首页
    • English
    • 中文
  • 关于我们
  • 服务项目
    • 谷歌SEO服务
    • WordPress建站服务
    • 谷歌ADS/SEM代运营
  • 项目案例
    • 医疗
    • 建材
    • 机械加工
    • 照明
    • 电商
    • 电脑硬件
  • 博客
    • 服务器运维
      • aliyun
      • 服务器安装
      • 宝塔面板
      • 虚拟化
      • 阿里云
      • Centos
      • linux
      • nginx
    • 电子商务
    • 免费资源
    • PHP
      • Magento
      • WordPress
    • 大数据采集
    • Python
    • Javascript
    • SEO
    • 未分类
  • 联系我们
What's Hot

机械模具加工公司网站设计案例

24 10 月, 2023

快速原型公司案例

24 10 月, 2023

陶瓷加工网站案例

24 10 月, 2023
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram
VPSEO VPSEO
  • 首页
    • English
    • 中文
  • 关于我们
  • 服务项目
    • 谷歌SEO服务
    • WordPress建站服务
    • 谷歌ADS/SEM代运营
  • 项目案例
    • 医疗
    • 建材
    • 机械加工
    • 照明
    • 电商
    • 电脑硬件
  • 博客
    • 服务器运维
      • aliyun
      • 服务器安装
      • 宝塔面板
      • 虚拟化
      • 阿里云
      • Centos
      • linux
      • nginx
    • 电子商务
    • 免费资源
    • PHP
      • Magento
      • WordPress
    • 大数据采集
    • Python
    • Javascript
    • SEO
    • 未分类
  • 联系我们
VPSEO VPSEO
Home»服务器安装»Tengine 2.2.2 全模块安装 http_substitutions_filter_module http_geoip_module http_concat_module 压缩 替换 地理位置 SSL
服务器安装

Tengine 2.2.2 全模块安装 http_substitutions_filter_module http_geoip_module http_concat_module 压缩 替换 地理位置 SSL

chrispengcnBy chrispengcn7 8 月, 2021没有评论1 Min Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email

 

yum install gcc-c ++ pcre-devel zlib-devel make unzip libuuid-devel
yun install git

git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git

 

cd /usr/src

 

# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz

# tar -zxvf GeoIP.tar.gz

# cd GeoIP-1.4.8

# ./configure

# make; make install

# 刚才安装的库自动安装到 /usr/local/lib 下,所以这个目录需要加到动态链接配置里面以便运行相关程序的时候能自动绑定到这个 GeoIP 库:
# echo ‘/usr/local/lib’ > /etc/ld.so.conf.d/geoip.conf
#
# ldconfig

 

 

cd /usr/src

wget http://tengine.taobao.org/download/tengine-2.2.2.tar.gz

tar -xvzf tengine-2.2.2.tar.gz

cd tengine-2.2.2


./configure --prefix=/usr/local/nginx --with-http_gzip_static_module --with-http_geoip_module=shared --with-http_sub_module=shared --with-http_flv_module=shared --with-http_random_index_module=shared --with-http_access_module=shared --with-http_autoindex_module=shared --with-http_upstream_ip_hash_module=shared --with-http_upstream_least_conn_module=shared --with-http_concat_module=shared --add-module=/git/ngx_http_substitutions_filter_module --with-http_stub_status_module --with-http_ssl_module

 

默认安装在/usr/local/nginx目录下,启动nginx,使用nginx -m并看不到动态模块,因为还没插入,所有的模块都是static的。

默认的动态模块在modules目录里面,这时候可动态插入的模块还没有被加入配置文件,我们可以手动加入/usr/local/nginx/conf/nginx.conf中

dso {
load ngx_http_access_module.so;
load ngx_http_autoindex_module.so;
load ngx_http_flv_module.so;
load ngx_http_geoip_module.so;
load ngx_http_random_index_module.so;
load ngx_http_sub_filter_module.so;
load ngx_http_upstream_ip_hash_module.so;
load ngx_http_upstream_least_conn_module.so;

}

启动nginx后使用nginx -m就可以看到懂爱模块都被标记被shared

Tengine动态开启模块试用

 

 

==========================GeoIP 模块设置============================================
# 下载Ip 数据库, 可放到 网站根目录 /var/www/GeoIP.dat
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
#
# gunzip GeoIP.dat.gz

# vi /etc/nginx/nginx.conf

 

h
http {
.
…
g
geoip_country /home/vpsee/GeoIP.dat;
f
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
f
fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3;
f
fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
.
…
}
}

 

s
server {
.
…

location / {

root /home/vpsee/www;

if ($geoip_country_code = CN) {

root /home/vpsee/cn;

}

…

}
.
…
}
}

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
chrispengcn
  • Website

Related Posts

Centos系统下安装Centos-WebPanel(CWP)

12 1 月, 2022

Varnish 5.1 & WordPress 带来内存级加速

9 1 月, 2022

Ventoy.net 最牛逼的装机U盘软件

26 12 月, 2021

How to install latest version of OpenSSL on CentOS?

7 8 月, 2021
Add A Comment

Leave A Reply Cancel Reply

*

code

导航
  • 首页
  • 关于我们
  • 服务项目
  • 项目案例
  • 博客文章
  • 联系我们
博客
  • 服务器运维
  • 服务器安装
  • nginx
  • PHP
  • WordPress
  • Python
  • Javascript
  • SEO
  • 电子商务
  • 大数据采集
  • 宝塔面板
  • 数据库
  • 电子商务
  • 虚拟化
  • 阿里云
导航
  • 首页
  • 关于我们
  • 谷歌SEO服务
  • 谷歌ADS/SEM代运营
  • WordPress建站服务
  • 项目案例
  • 博客
  • 联系我们
最新文章
  • 机械模具加工公司网站设计案例
  • 快速原型公司案例
  • 陶瓷加工网站案例
  • CNC数控加工日文网站案例
  • 触摸一体机数字标牌厂家网站案例
关于我们
关于我们

广州纬来科技有限公司
联系地址:广东省广州市番禺区富华中路富源二街18号合和大厦809

QQ : 13602156
Email : 13926026058@139.com
Contact: +86 13926026058

Facebook Twitter YouTube LinkedIn
© 2025 广州纬来科技有限公司 粤ICP备2023105857号-2
  • 首页
  • 关于我们
  • 谷歌SEO服务
  • 谷歌ADS/SEM代运营
  • WordPress建站服务
  • 项目案例
  • 博客
  • 联系我们

Type above and press Enter to search. Press Esc to cancel.