ubuntu18.04 编译Tengine

下载pcre、openssl、zlib三个源码包

ngx_murmur_hash2文件出现错误,编译选项增加 -Wno-error 

使用openssl-1.1.1会导致以下错误

/opt/ngnix/openssl-1.1.1/.openssl/lib/libcrypto.a(threads_pthread.o): In function `fork_once_func':
threads_pthread.c:(.text+0x16): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status

编译脚本:

./configure --with-cc-opt="-Wno-error" \
--with-pcre=/path/to/pcre-8.38 \
--with-openssl=/path/to/openssl-1.1.0i \
--with-zlib=/path/to/zlib-1.2.11

make

 

安装openssl-1.1.0i后openssl命令出错:

有两个 libcrypto.so.1.1  文件,默认使用了 /usr/lib/x86_64-linux-gnu 下的。

使用 objdump -tT /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 | grep EVP_mdc2 查看动态库,并没有对应的符号。

然后 sudo cp /usr/local/lib/libcrypto.so.1.1 libcrypto.so.1.1 替换一下。

 

集成lua

  1. LuaJIT can be downloaded from the latest release of OpenResty's LuaJIT branch version. The official LuaJIT 2.0 and 2.1 releases are also supported, although the performance will be significantly lower in many cases.
  2. Download the latest version of the ngx_devel_kit (NDK) module HERE.
  3. Download the latest version of ngx_lua HERE.
  4. Download the latest version of Nginx HERE (See Nginx Compatibility)

下载luajit  make && make install 

最后的编译脚本

# tell nginx's build system where to find LuaJIT 2.1:
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1


./configure --with-cc-opt="-Wno-error" \
--with-ld-opt="-Wl,-rpath,/usr/local/lib" \
--with-pcre=/path/to/pcre-8.38 \
--with-openssl=/path/to/openssl-1.1.0i \
--with-zlib=/path/to/zlib-1.2.11 \
--add-module=/path/to/ngx_devel_kit-0.3.0 \
--add-module=/path/to/lua-nginx-module-0.10.13

make -j2
#make install

 mysql支持,下载lua-resty-mysql: https://github.com/openresty/lua-resty-mysql 

sudo cp lib/resty/mysql.lua  /usr/local/share/lua/5.1/resty/mysql.lua

 

转载于:https://www.cnblogs.com/csig/p/9957464.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值