安装nginx环境(含lua)时遇到报错ngx_http_lua_common.h:20:20: error: luajit.h: No such file or directory的解决
下面是安装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
# 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的解决的更多相关文章
- 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 ...
- pecl安装php的ev扩展时的报错处理
pecl安装php的ev扩展,安装完毕后php.ini中加入扩展extension=ev.so,然后重启php-fpm出现以下报错 PHP Warning: PHP Startup: Unable ...
- 在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 ...
- Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决
Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent: ...
- 开发错误记录11:git报错 fatal:open /dev/null or dup failed: No such file or directory
今天在自己的的电脑上装了git,没成想运行报错: 重装了几次git ,都不行,电脑上没有装github桌面版; 后来在网上查到了方法,反映这是系统的问题: null是比较特殊的系统文件,它实际上是为操 ...
- 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 ...
- 【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 ...
- myeclipse打war包时,报错security alert integrity check error
今天在用myeclipse打包项目时,出现如下图的提示: 在网上查找了一下原因,主要是由于Jar包不符合所导致的.解决办法如下: 将com.genuitec.eclipse.export.wizard ...
- 按照教程自动安装RFNoC时.在使用pip安装pybombs时出现报错,解决办法
$ sudo apt-get install git $ sudo apt-get install python-setuptools python-dev python-pip build-esse ...
随机推荐
- spring中RequestBody注解接收参数时用JSONField转参数名无效问题
问题: 在springboot项目中使用@RequestBody注解接收post请求中body里的json参数的情况.即: @RequestMapping(value = "/get-use ...
- 硬盘分区及Linux文件系统
1. 硬盘物理结构 硬盘物理上主要分为: 盘片 磁道 扇区 机械臂 磁头 主轴 磁道: 当硬盘盘片旋转时,磁头若固定在一个位置上,则磁头会在盘片表面划出一个圆形轨迹,这些圆形轨迹就叫做磁道.以盘片中心 ...
- 【Docker学习之六】Docker容器互联
环境 docker-ce-19.03.1-3.el7.x86_64 centos 7 一.基于Volume的互联就是-v参数,将本机文件或目录挂载到容器目录,实现文件目录共享 二.基于Link的互联 ...
- python结巴分词SEO的应用详解
结巴分词在SEO中可以应用于分析/提取文章关键词.关键词归类.标题重写.文章伪原创等等方面,用处非常多. 具体结巴分词项目:https://github.com/fxsjy/jieba ...
- ThreadLocal源代码2
private static int nextIndex(int i, int len) { return ((i + 1 < len) ? i + 1 : 0); } private stat ...
- java字符串截取
import org.apache.commons.lang.StringUtils; public class substr{ public static void main(String[] ar ...
- 自定义注解实现简单的orm映射框架
package com.mj; import javax.xml.bind.Element; import java.lang.annotation.*; import java.lang.refle ...
- vs 远程调试
程序在vs安装目录: D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugge ...
- java-工厂
class Mouse{ public void sayHi(){}; } class DellMouse extends Mouse { @Override public void sayHi() ...
- 基于layUI调用后台数据实现区域信息级联查询
基于layUI调用后台数据实现区域信息级联查询 1.基本思路 后台提供根据区域编码查询区域列表公共接口 页面初始化调用后台接口加载所有省份 点击省份将省份区域编码传入后台查询该省份下所有地市信息,以此 ...