下面是安装nginx+lua环境时使用的相关模块及版本,ngx_devel_kit和lua-nginx-module模块用的都是github上最新的模块.并进行了LuaJIT的安装。

  

#Install nginx by 2019-12-12
yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
useradd -s /sbin/nologin -M nginx
cd /usr/local/src
wget http://nginx.org/download/nginx-1.14.2.tar.gz
wget http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.14.tar.gz
wget http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz\
git clone git://github.com/yzprofile/ngx_http_dyups_module.git
tar zxf v0.3.0.tar.gz
tar zxf LuaJIT-2.1.0-beta3.tar.gz
tar zxf v0.10.14.tar.gz
tar zxf nginx-1.14.2.tar.gz
yum -y install lua-devel
cd LuaJIT-2.1.0-beta3
make && make install
cd ..
cd nginx-1.14.2 ./configure --prefix=/usr/local/nginx --sbin-path=/usr/bin/nginx   --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module  --with-pcre --with-http_stub_status_module  --with-http_addition_module --with-http_gzip_static_module  --with-file-aio --with-http_dav_module --add-module=../ngx_devel_kit-0.3.0 --add-module=../lua-nginx-module-0.10.14 --add-module=../ngx_http_dyups_module
make
make install

  

[root@lua src]# ll
total 3520
-rw-r--r-- 1 root root 1213 Dec 12 17:12 install-nginx.sh
drwxr-xr-x 6 nginx nginx 100 May 2 2017 LuaJIT-2.1.0-beta3
-rw-r--r-- 1 root root 1025180 May 2 2017 LuaJIT-2.1.0-beta3.tar.gz
drwxrwxr-x 10 root root 225 Feb 24 2019 lua-nginx-module-0.10.14
-rw-r--r-- 1 root root 829900 Dec 12 17:23 lua-nginx-module-master.zip
drwxr-xr-x 9 1001 1001 186 Dec 12 16:57 nginx-1.14.2
-rw-r--r-- 1 root root 1015384 Dec 4 2018 nginx-1.14.2.tar.gz
drwxrwxr-x 9 root root 221 May 10 2016 ngx_devel_kit-0.3.0
drwxr-xr-x 4 root root 187 Dec 12 17:04 ngx_http_dyups_module
-rw-r--r-- 1 root root 654097 Dec 12 16:56 v0.10.14.tar.gz
-rw-r--r-- 1 root root 66455 Dec 12 16:56 v0.3.0.tar.gz

  .configure执行是成功的,但是在进行make的时候遇到报错:ngx_http_lua_common.h:20:20: error: luajit.h: No such file or directory,详细报错内容如下:

In file included from ../lua-nginx-module-0.10.15/src/ngx_http_lua_script.h:11:0,
from ../lua-nginx-module-0.10.15/src/ngx_http_lua_script.c:13:
../lua-nginx-module-0.10.14/src/ngx_http_lua_common.h:20:20: fatal error: luajit.h: No such file or directory
#include <luajit.h>
^
compilation terminated.
make[1]: *** [objs/addon/src/ngx_http_lua_script.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-1.14.2'
make: *** [build] Error 2

 

解决方法:把lib的路径写入/etc/profile中
# vim /etc/profile
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/user/local/include/luajit-2.1
# source /etc/profile

 重新编译即可成功! 

 

[root@lua src]# nginx
nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
[root@lua src]# find / -name libluajit-5.1.so.2
/usr/local/lib/libluajit-5.1.so.2
[root@lua src]# ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2
[root@lua src]# nginx -V
nginx version: nginx/1.14.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/bin/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-pcre --with-http_stub_status_module --with-http_addition_module --with-http_gzip_static_module --with-file-aio --with-http_dav_module --add-module=../ngx_devel_kit-0.3.0 --add-module=../lua-nginx-module-0.10.14 --add-module=../ngx_http_dyups_module

  

 

 

安装nginx环境(含lua)时遇到报错ngx_http_lua_common.h:20:20: error: luajit.h: No such file or directory的解决的更多相关文章

  1. CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory

    今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or direc ...

  2. pecl安装php的ev扩展时的报错处理

    pecl安装php的ev扩展,安装完毕后php.ini中加入扩展extension=ev.so,然后重启php-fpm出现以下报错 PHP Warning:  PHP Startup: Unable ...

  3. 在caffe-ssd安装编译环境运行make all时候报错:Makefile:572: recipe for target '.build_release/src/caffe/util/hdf5.o' failed make: *** [.build_release/src/caffe/util/hdf5.o] Error 1

    解决办法: 修改:Makefile.config INCLUDE_DIRS /usr/include/hdf5/serial/ 修改:Makefile LIBRARIES hdf5_hl and hd ...

  4. Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决

    Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent: ...

  5. 开发错误记录11:git报错 fatal:open /dev/null or dup failed: No such file or directory

    今天在自己的的电脑上装了git,没成想运行报错: 重装了几次git ,都不行,电脑上没有装github桌面版; 后来在网上查到了方法,反映这是系统的问题: null是比较特殊的系统文件,它实际上是为操 ...

  6. mysql数据库报错:InnoDB: Operating system error number 13 in a file operation

    环境:centos6.5 x86_64 启动mysql发现日志报错(日志路径可以查看/etc/my.cnf的配置) 160722 10:34:08 [Note] Found 42570716 of 4 ...

  7. 【Flink】flink执行jar报错:java.io.IOException: Error opening the Input Split file 或者 java.io.FileNotFoundException

    报错内容 flink执行jar时,报如下错误: org.apache.flink.client.program.ProgramInvocationException: Job failed. (Job ...

  8. myeclipse打war包时,报错security alert integrity check error

    今天在用myeclipse打包项目时,出现如下图的提示: 在网上查找了一下原因,主要是由于Jar包不符合所导致的.解决办法如下: 将com.genuitec.eclipse.export.wizard ...

  9. 按照教程自动安装RFNoC时.在使用pip安装pybombs时出现报错,解决办法

    $ sudo apt-get install git $ sudo apt-get install python-setuptools python-dev python-pip build-esse ...

随机推荐

  1. Centos7之阿里Arthas部署

    阿里Arthas Arthas(阿尔萨斯)是Alibaba开源的一个Java诊断工具,无需做任何配置,就可以直观的获取各种维度的性能数据,方便开发者进行问题的定位和诊断. 应用场景 动态跟踪Java代 ...

  2. 【Spring Cloud学习之六】断路器-Hystrix

    环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 Spring Cloud 1.2 一.服务雪崩1.什么是服务雪崩分布式系统中经常会出现某个基础服务不可用造成整个系统不 ...

  3. 机器学习之挖掘melb_data.csv数据

    mel_data.csv是关于melb地区房屋的数据 mel_data.csv import pandas as pd melbourne_file_path = "E:\data\Melb ...

  4. mac下php配置

    打开/关闭服务 sudo apachectl start sudo apachectl stop 查看apche版本 apacectl -v 修改项目默认路径: 打开配置文件目录/private/et ...

  5. Python实现双链表

    双向链表(Double_linked_list)也叫双链表,是链表的一种,它的每个数据结点中都有两个指针,分别指向直接后继和直接前驱.所以,从双向链表中的任意一个结点开始,都可以很方便地访问它的前驱结 ...

  6. [BZOJ4382][POI2015]Podział naszyjnika (神奇HASH)

    [问题描述]    长度为n 的一串项链,每颗珠子是K 种颜色之一.第i 颗与第i-1,i+1 颗珠子相邻,第n 颗与第1 颗也相邻.    切两刀,把项链断成两条链.要求每种颜色的珠子只能出现在其中 ...

  7. UI单据按钮点击事件校验

    一.按钮点击前事务处理<BeforeEventProcess> public override void BeforeEventProcess(IPart part, string eve ...

  8. vue中sessionStorage的使用

    转载:https://www.cnblogs.com/denken/p/11197612.html localStorage 和 sessionStorage 属性允许在浏览器中存储 key/valu ...

  9. MNIST机器学习入门(二)

    在前一个博客中,我们已经对MNIST 数据集和TensorFlow 中MNIST 数据集的载入有了基本的了解.本节将真正以TensorFlow 为工具,写一个手写体数字识别程序,使用的机器学习方法是S ...

  10. C# Datatable、DataReader等转化json

    //对象转换为Json字符串 public static string ToJson(object jsonObject) { object objectValue = string.Empty; s ...