- tengine安装,注意没有空格
./configure \
--prefix=/usr/local/tengine/ \
--error-log-path=/usr/local/tengine/log/error.log \
--http-log-path=/usr/local/tengine/log/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \ # 流媒体模块,可选
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/usr/local/tengine/client/ \
--http-proxy-temp-path=/usr/local/tengine/proxy/ \
--http-fastcgi-temp-path=/usr/local/tengine/fcgi/ \
--http-uwsgi-temp-path=/usr/local/tengine/uwsgi \
--http-scgi-temp-path=/usr/local/tengine/ \
--with-pcre \
--with-stream
./configure \
--prefix=/opt/soft/tengine \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-scgi-temp-path=/opt/soft/tengine \
--with-pcre \
--with-stream
Tengine+Lua插件编译安装
安装必须类库
yum -y install gcc gcc-c+ pcre-devel openssl openssl-devel
1、安装lua插件
需要LuaJIT-2.0.4.tar.gz,ngx_devel_kit,lua-nginx-module
1.1、下载安装LuaJIT-2.0.4.tar.gz
wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
tar xzvf LuaJIT-2.0.4.tar.gz
cd LuaJIT-2.0.4
make install PREFIX=/usr/local/luajit
配置环境变量
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
1.2、下载解压ngx_devel_kit
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz
tar -xzvf v0.3.0.tar.gz
1.3、下载解压lua-nginx-module
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.8.tar.gz
tar -xzvf v0.10.8.tar.gz
2、安装 tengine
2.1、下载解压Tengine
http://tengine.taobao.org/download/tengine-2.2.3.tar.gz
tar -xvf tengine-2.2.3.tar.gz
cd tengine-2.2.3
2.2、编译、安装
./configure \
--prefix=/erp/tng/ \
--error-log-path=/erp/tng/log/error.log \
--http-log-path=/erp/tng/log/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/erp/tng/client/ \
--http-proxy-temp-path=/erp/tng/proxy/ \
--http-fastcgi-temp-path=/erp/tng/fcgi/ \
--http-uwsgi-temp-path=/erp/tng/uwsgi \
--http-scgi-temp-path=/erp/tng/ \
--with-pcre \
--add-module=/opt/src/tng/lua-nginx-module-0.10.8 \
--add-module=/opt/src/tng/ngx_devel_kit-0.3.0 \
--with-ld-opt="-Wl,-rpath,${LUAJIT_LIB}"
make
make install
3、ubuntu 安装 tengine
https://www.cnblogs.com/lushichao/p/14278778.html
> openssl报错
报错内容
src/event/ngx_event_openssl.c:973:9: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
解决方法:使用旧版本的openssl。
参考: http://t.csdn.cn/HMAcB
下载
https://www.openssl.org/source/old/1.1.1/openssl-1.1.1p.tar.gz
卸载已安装的openssl
编译安装
cd openssl-1.1.1p
./config --prefix=//usr/local/openssl-1.1.1p
make
chmod a+x util/shlib_wrap.sh
make install
> 编译时报config没找到
># 报错内容如下
/bin/sh:行2: ./config: 没有那个文件或目录
make[1]: *** [/usr/local/openssl/.openssl/include/openssl/ssl.h] 错误 127
> # 解决办法
参考: http://t.csdn.cn/ljvVa
cd tengine-2.3.3
cd auto/lib/openssl
# 修改conf文件,删除.openssl/
vim conf
39 CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
40 CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
41 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
42 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
修改为:
39 CORE_INCS="$CORE_INCS $OPENSSL/include"
40 CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
41 CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
42 CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"