[root@src]# ll -a nginx-1.14.2.tar.gz LuaJIT-2.0.5.tar.gz -rw-r--r-- 1 root root 849845 May 2 2017 LuaJIT-2.0.5.tar.gz -rw-r--r-- 1 root root 1015384 Dec 4 22:58 nginx-1.14.2.tar.gz [root@src]#wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.1rc1.tar.gz [root@src]#wget https://github.com/openresty/lua-nginx-module/archive/v0.10.14.tar.gz [root@src]#wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz luajit的编译 cd LuaJIT-2.0.5/ make clean make make install PREFIX=/usr/local/luajit export LUAJIT_LIB=/usr/local/luajit/lib export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0 cd ../nginx-1.14.2/ ./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-http_gzip_static_module --with-stream --with-stream_ssl_module --with-http_flv_module --with-http_mp4_module --with-http_realip_module --with-openssl=/usr/local/src/openssl-1.0.2n --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.36 --with-ld-opt="-Wl,-rpath,/usr/local/luajit/lib" --add-module=/usr/local/nginx-module/nginx_mod_h264_streaming --add-module=/usr/local/nginx-module/nginx-rtmp-module --add-module=/usr/local/nginx-module/ngx_devel_kit --add-module=/usr/local/nginx-module/lua-nginx-module 因为安装了--add-module=/usr/local/nginx-module/nginx_mod_h264_streaming --add-module=/usr/local/nginx-module/nginx-rtmp-module 此时要修改个配置 vim objs/Makefile 修改这行: CFLAGS = -I/usr/local/luajit/include/luajit-2.0 -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -D_LARGEFILE_SOURCE -DBUILDING_NGINX -DNDK_SET_VAR 删掉:-Werror,保存 make && make install [root@src]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.14.2 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) built with OpenSSL 1.0.2n 7 Dec 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-http_gzip_static_module --with-stream --with-stream_ssl_module --with-http_flv_module --with-http_mp4_module --with-http_realip_module --with-openssl=/usr/local/src/openssl-1.0.2n --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.36 --with-ld-opt=-Wl,-rpath,/usr/local/luajit/lib --add-module=/usr/local/nginx-module/nginx_mod_h264_streaming --add-module=/usr/local/nginx-module/nginx-rtmp-module --add-module=/usr/local/nginx-module/ngx_devel_kit --add-module=/usr/local/nginx-module/lua-nginx-module nginx关键参数:--with-ld-opt=-Wl,-rpath,/usr/local/luajit/lib
后期报错:
nginx: 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/openres ty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
解决:luajit换最新版本的
wget https://github.com/openresty/luajit2/archive/v2.1-20190302.tar.gz