下面是安装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. PostgreSQL的递归查询(with recursive) ,替代oracle 的级联查询connect by

    开发有需求,说需要对一张地区表进行递归查询,Postgres中有个 with recursive的查询方式,可以满足递归查询(一般>=2层). 测试如下: create table tb(id ...

  2. python装饰器 语法糖

    简介: 装饰器(Decorators)是 Python 的一个重要部分.简单地说:他们是修改其他函数的功能的函数. 比如说我们写flask,路由就是用装饰器定义的.如果写权限控制,那么权限控制一般也是 ...

  3. 〓经典文字MUD武侠游戏 我的江湖 〓

    〓经典文字MUD武侠游戏 我的江湖 〓 我的江湖(FFLIB)基于地狱内核扩展,目前已扩展了很多实用功能! 我的江湖玩法 和掌心西游.书剑.东方故事.侠缘.武林等玩法大同小异 但扩展了更多好玩的玩法, ...

  4. 一款新的好用的SSH工具——FinalShell

    FinalShell是一体化的的服务器,网络管理软件,不仅是ssh客户端,还是功能强大的开发,运维工具,充分满足开发,运维需求.特色功能:免费海外服务器远程桌面加速,ssh加速,双边tcp加速,内网穿 ...

  5. mysql批量更新数据,循环select记录然后更新某一字段

    -- 处理IEMI重复的历史数据,建档日期(只有年月日)倒序,档案ID倒序,根据IMEI查档案,查询的结果,相同IMEI下的第一条记录的IEMI不处理,其他的记录的imei 改为空. -- USE ` ...

  6. [源码]Python调用C# DLL例子(Python与.Net交互)

    K8Cscan C# DLL例子代码 namespace CscanDLL { public class scan { public static string run(string ip) { if ...

  7. 洛谷P2048 [NOI2010]超级钢琴 题解

    2019/11/14 更新日志: 近期发现这篇题解有点烂,更新一下,删繁就简,详细重点.代码多加了注释.就酱紫啦! 正解步骤 我们需要先算美妙度的前缀和,并初始化RMQ. 循环 \(i\) 从 \(1 ...

  8. @PropertySouce注解 读取 properties文件

    https://www.cnblogs.com/whx7762/p/7885735.html 1.@ProtertySource @PropertySouce是spring3.1开始引入的基于java ...

  9. 【代码优化】C#遍历所有控件(Control方法)

    直接上代码: /// <summary> /// 判断价格是否可以购买技能的方法 /// </summary> /// <param name="btnBuyA ...

  10. 无法生成服务引用(添加WebService)

    参考地址:http://www.52study.org/bencandy-120-1076-1.html 问题场景:.在工程中添加WebService,报错: 解决办法:  1.配置该服务引用 将下面 ...