<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      NGINX+Lua模塊編譯安裝

      NGINX+Lua 環境配置

      一、環境裝備

      [root@web01 ~]# cat /etc/redhat-release 
      CentOS Linux release 7.7.1908 (Core)
      
      YUM下載安裝相關依賴環境
      [root@web01 ~]# yum install gcc gcc-c++ prce prce-devel \
      > autoconf make automake  \
      > openssl-devel openssl zlib-devel zlib \
      > httpd-tools gperftools -y  
      
      創建下載目錄
      [root@web01 ~]# cd /opt/;mkdir download 
      
      下載相關軟件
      v2.1-20210510.tar.gz      #不要下載官網的,要去下載openresty的優化版本 后面會說出現的坑
      lua-nginx-module-0.10.20.tar.gz  # 0.10.16 以后都需要3,4兩個包
      lua-resty-core-0.1.22.tar.gz [必須]
      lua-resty-lrucache-0.10.tar.gz [必須]
      nginx-1.17.5.tar.gz
      ngx_devel_kit-0.3.1.tar.gz
      
      對應下載的網站:https://github.com/openresty
      luajit: wget --no-check-certificate https://github.com/openresty/luajit2/archive/refs/tags/v2.1-20210510.tar.gz
      lua-nginx-module:wget --no-check-certificate https://github.com/openresty/lua-nginx-module/archive/refs/tags/v0.10.20.tar.gz
      lua-resty-core:wget --no-check-certificate https://github.com/openresty/lua-resty-core/archive/refs/tags/v0.1.22.tar.gz
      lua-resty-lrucache:wget --no-check-certificate https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v0.11.tar.gz
      nginx-1.17.5:wget --no-check-certificate http://nginx.org/download/nginx-1.17.5.tar.gz
      ngx_devel_kit-0.3.1:wget --no-check-certificate https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v0.3.1.tar.gz
      

      二、解壓安裝相應的軟件

      [root@web01 /opt/download]# ls *.tar.gz | xargs -n1 tar xzvf
      [root@web01 /opt/download]# cd luajit2-2.1-20210510
      make install  PREFIX=/usr/local/LuaJIT
      添加環境變量
      export LUAJIT_LIB=/usr/local/LuaJIT/lib
      export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.1
      [root@web01 /opt/download]# tail -3f /etc/profile
      #Lua
      export LUAJIT_LIB=/usr/local/LuaJIT/lib
      export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.1
      
      安裝Lua核心庫
      lua-resty-core-0.1.21.tar.gz [必須]
      lua-resty-lrucache-0.11.tar.gz [必須]
      
      安裝在同一個目錄下
      cd lua-resty-core-0.1.22
      make install PREFIX=/usr/local/lua_core
      cd ../lua-resty-lrucache-0.11
      make install PREFIX=/usr/local/lua_core
      
      編譯安裝NGINX
      [root@web01 /opt/download]# cd nginx-1.17.2/
       ./configure --prefix=/etc/nginx \
       --sbin-path=/usr/sbin/nginx \
       --modules-path=/usr/lib64/nginx/modules \
       --conf-path=/etc/nginx/nginx.conf \
       --error-log-path=/var/log/nginx/error.log \
       --http-log-path=/var/log/nginx/access.log \
       --http-client-body-temp-path=/var/lib/nginx/tmp/client_body \
       --http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
       --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \
       --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
       --http-scgi-temp-path=/var/lib/nginx/tmp/scgi \
       --pid-path=/run/nginx.pid \
       --lock-path=/run/lock/subsys/nginx \
       --user=nginx --group=nginx \
       --with-compat --with-debug --with-file-aio \
       --with-google_perftools_module \
       --with-http_addition_module \
       --with-http_auth_request_module \
       --with-http_dav_module \
       --with-http_degradation_module \
       --with-http_flv_module \
       --with-http_gunzip_module \
       --with-http_geoip_module \
       --with-http_gzip_static_module \
       --with-http_image_filter_module=dynamic \
       --with-http_mp4_module \
       --with-http_perl_module=dynamic \
       --with-http_random_index_module \
       --with-http_realip_module \
       --with-http_secure_link_module \
       --with-http_slice_module \
       --with-http_ssl_module \
       --with-http_stub_status_module \
       --with-http_sub_module \
       --with-http_v2_module --with-http_xslt_module=dynamic \
       --with-mail=dynamic --with-mail_ssl_module \
       --with-pcre --with-pcre-jit \
       --with-stream=dynamic --with-stream_ssl_module \
       --with-stream_ssl_preread_module --with-threads \
       --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' \
       --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' \
       --add-module=/opt/download/ngx_devel_kit-0.3.1 \
       --add-module=/opt/download/lua-nginx-module-0.10.20
      
      加載lua庫,加入到ld.so.conf文件
      [root@web01 ~]# cat  /etc/ld.so.conf.d/libc.conf
      /usr/local/lib
      /usr/local/LuaJIT/lib
      [root@web01 ~]#  ldconfig
      

      測試Lua環境

      主配置文件添加如下:nginx.conf
      添加在http模塊下
      # 指定lua模塊路徑,多個之間";"分隔,其中";;"表示默認搜索路徑,默認到nginx的根目錄下找
      lua_package_path "/usr/local/Lua_core/lib/lua/?.lua;;";
      #指定server配置文件目錄
      include /etc/nginx/conf.d/*.conf;
      
      server配置如下
      [root@web01 /etc/nginx/conf.d]# cat test_lua.conf 
      server {
          listen       80;
          server_name 10.4.7.8 www.server1.com;
       
          location /lua {
              set $test "hello,world";
              content_by_lua '
                  ngx.header.content_type="text/plain"
                  ngx.say(ngx.var.test)';
       
          }
       
      }
      

      上面都是經過安裝的一些坑之后安裝完成的,下面是安裝過程中出現的坑

      坑一:

      nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
      # 讓我不要用這個luajit版本,可以用openresty提供的luajit優化版本,或者干脆直接用openresty
      卸載luajit官網版本,下載openresty提供的luajit優化版本
      

      坑二:

      nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from https://openresty.org/en/download.html (reason: module 'resty.core' not found:
              no field package.preload['resty.core']
              no file '../lua-resty-core/lib/resty/core.lua'
              no file '../lua-resty-lrucache/lib/resty/core.lua'
              no file './resty/core.lua'
              no file '/usr/local/LuaJIT/share/luajit-2.0.5/resty/core.lua'
              no file '/usr/local/share/lua/5.1/resty/core.lua'
              no file '/usr/local/share/lua/5.1/resty/core/init.lua'
              no file '/usr/local/LuaJIT/share/lua/5.1/resty/core.lua'
              no file '/usr/local/LuaJIT/share/lua/5.1/resty/core/init.lua'
              no file './resty/core.so'
              no file '/usr/local/lib/lua/5.1/resty/core.so'
              no file '/usr/local/LuaJIT/lib/lua/5.1/resty/core.so'
              no file '/usr/local/lib/lua/5.1/loadall.so'
              no file './resty.so'
              no file '/usr/local/lib/lua/5.1/resty.so'
              no file '/usr/local/LuaJIT/lib/lua/5.1/resty.so'
              no file '/usr/local/lib/lua/5.1/loadall.so') in /etc/nginx/nginx.conf:117
      網上查找的結果是說
      這個問題到git上面看了 ,https://github.com/openresty/lua-nginx-module/issues/1509
      就是在nginx.conf 中的 http{}模塊中加入下面這行代碼:lua_load_resty_core off;但是檢查的時候發現這命令已經廢棄
      

      按照上面說安裝lua-resty-core和依賴文件lua-resty-lrucache解決問題

      lua-resty-core-0.1.22.tar.gz 
      lua-resty-lrucache-0.10.tar.gz
      
      posted @ 2021-08-19 17:33  海上月  閱讀(4228)  評論(1)    收藏  舉報
      主站蜘蛛池模板: 中文字幕人妻不卡精品| 日本无遮挡吸乳视频| 国产精品毛片一区二区 | 精品久久人人妻人人做精品| 樱桃视频影院在线播放| yy111111少妇无码影院| 国产在线视频不卡一区二区| 齐河县| 日本一区二区三区在线看| 人妻少妇精品中文字幕| 老色鬼在线精品视频| 国产女人叫床高潮大片| 色综合久久中文综合久久激情| 三上悠亚精品一区二区久久| 欧美最新精品videossexohd| 国产一区二区不卡精品视频| 国产普通话对白刺激| 麻豆精品一区二区综合av| 欧美大胆老熟妇乱子伦视频| 亚洲欧美在线综合一区二区三区| 色色97| 97人人模人人爽人人少妇| 久久精品女人的天堂av| 国产日韩入口一区二区| 国产精品爆乳在线播放第一人称| 黑人巨大粗物挺进了少妇| 亚洲女同精品久久女同| 黑巨人与欧美精品一区| 看全色黄大色黄大片 视频| 免费无码成人AV片在线| 97久久精品人人做人人爽| 精品国产一区AV天美传媒| 91精品国产蜜臀在线观看| 午夜综合网| 中文字幕va一区二区三区| 日本公妇乱偷中文字幕| 精品国产亚洲午夜精品a| 精品视频福利| 麻豆精品国产熟妇aⅴ一区| 亚洲精品午夜精品| 国语精品一区二区三区|