zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    简单的纯css菜单
    提高 web 应用性能之 JavaScript 性能调优(转)
    从拖延者到行动派的10个秘诀(转)
    程序员,你应该知道(转)
    幽默的经济学+组织领导学
    [SQL基础]统计信息解释
    演讲集合
    最隐晦的程序设计指引(转)
    windows 7 "unmountable boot volume" 解决方法
    kafka与springboot集成2
  • 原文地址:https://www.cnblogs.com/csig/p/9957464.html
Copyright © 2011-2022 走看看