环境:centos,云锁,tengine
安装前做好备份:yum -y install jemalloc pcre* openssl*
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
1.下载(需要重新下载之前的tengine版本):
下载tengine:
#cd /usr/local/
#wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
#tar zxvf tengine-2.1.2.tar.gz
下载云锁模块:
#wget https://codeload.github.com/yunsuo-open/nginx-plugin/zip/master -O nginx-plugin-master.zip
#unzip nginx-plugin-master.zip
2.查看之前都加载了什么模块:
#nginx -V
我本机加载模块大致如下:
--with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_upstream_check_module
3.安装与配置(常用模块):
#cd tengine-2.1.2
#./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_upstream_check_module --add-module=/usr/local/nginx-plugin-master
即,在正常安装tengine的步骤下多出: --add-module=/usr/local/nginx-plugin-master
# make
注意:切记不要执行make install ,不然会覆盖掉之前配置的 nginx.conf
rm -rf /usr/local/nginx/sbin/nginx
cp objs/nginx /usr/local/nginx/sbin/nginx
service nginx restart
4.让云锁识别您自己编译的tengine:
cd /usr/local/yunsuo_agent/nginx/
./configure_compile_nginx /usr/local/nginx