一.两个依赖包 有yum的直接

yum   yum –y install openssl openssl-devel prce prce-devel zlib zlib-devel

没有yum环境的,可以源码安装:

cd /usr/local

wget https://sourceforge.net/projects/pcre/files/pcre/8.37/pcre-8.37.tar.gz

tar  zxf  pcre-8.37.tar.gz

cd pcre-8.37 && ./configure &&make&&make install

wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz

tar zxf openssl-1.0.1c.tar.gz

cd openssl-1.0.1c.tar.gz &&./config --prefix=/usr/local/openssl -fPIC no-gost no-shared no-zlib

make depend &&make install

wget http://www.zlib.net/zlib-1.2.11.tar.gz

tar zxf zlib-1.2.11.tar.gz

cd /usr/local/zlib-1.2.11 &&./configure

make && make install

二.然后安装LuaJIT

mkdir /usr/local/modules   ###存放所以的第三方模块目录

cd /usr/local/modules

1.wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz

tar -zxvf LuaJIT-2.0.5.tar.gz

cd LuaJIT-2.0.5

make install PREFIX=/usr/local/LuaJIT

最后一行会输出一下提示:

==== Successfully installed LuaJIT 2.0.5 to /usr/local/LuaJIT ====

vi /etc/profile   文件末尾加入环境变量

export LUAJIT_LIB=/usr/local/LuaJIT/lib

export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0

source /etc/profile

ln -s /usr/local/luajit/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2 #不增加这行,nginx启动会报错

2.下载ngx_devel_kit(NDK)模块 :https://github.com/simpl/ngx_devel_kit/tags,不需要安装

wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz

tar -xzvf v0.3.0.tar.gz

3.下载最新的lua-nginx-module 模块 :https://github.com/openresty/lua-nginx-module/tags,不需要安装

wget https://github.com/openresty/lua-nginx-module/archive/v0.10.8.tar.gz

tar -xzvf v0.10.8.tar.gz

三.sticky模块(cookie负载均衡,存在客户端的)

wget https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/master.tar.gz

tar -zxf master.tar.gz

nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d.tar.gz(这个包是tengine sticky的扩展包)

mv  nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d/ nginx-sticky

四.tengine安装(nginx也是一样)

tengine-2.1.1.tar.gz

tar zxf tengine-2.1.1.tar.gz

cd  tengine-2.1.1

./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.37 --with-pcre-jit --with-zlib=/usr/local/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.0.1c --with-http_sub_module --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module  --with-http_realip_module --with-http_spdy_module --with-http_gunzip_module --with-http_gzip_static_module --add-module=/usr/local/modules/ngx_devel_kit-0.3.0 --add-module=/usr/local/modules/lua-nginx-module-0.10.8 --add-module=/usr/local/modules/nginx-sticky/

make

make install

安装后:

/usr/local/nginx/sbin/nginx -t   查看状态

/usr/local/nginx/sbin/nginx     启动nginx

在/usr/local/nginx/conf/nginx.conf中加入如下代码:

location /hello_lua {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}

重启nginx

访问10.211.55.3/hello_lua会出现”hello, lua”表示lua安装成功

Tengine编译安装+lua+sticky模块的更多相关文章

  1. vim编译安装+lua模块

    vim编译安装+lua模块 使用背景:代码自动补全插件,需要安装lua模块 安装准备,首先下载安装vim所依赖的其它安装包,ncurses,lua,readline,vim 源码下载,编译安装 ncu ...

  2. tengine编译安装及nginx高并发内核参数优化

    Tengine Tengine介绍 Tengine是由淘宝网发起的Web服务器项目.它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性. Tengine的性能和稳定性已经在大型的 ...

  3. 编译安装带ssl 模块指定版本Python

      出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries ...

  4. Nginx 最新版源码编译安装 包含常用模块作用及所需依赖

    第一部分 Nginx最新版源码编译安装 1. 使用的模块 模块1:http_rewrite_module 基于正则匹配来实现重定向.依赖PCRE库,见依赖1 模块2:http_gzip_module ...

  5. 【01】Nginx:编译安装/动态添加模块

    写在前面的话 说起 Nginx,别说运维,就是很多开发人员也很熟悉,毕竟如今已经 2019 年了,Apache 更多的要么成为了历史,要么成为了历史残留. 我们在提及 Nginx 的时候,一直在强调他 ...

  6. Linux下编译安装Apache及模块

    Apache是时下最流行的Webserver软件之中的一个,支持多平台,可高速搭建web服务,并且稳定可靠.并可通过简单的API扩充.就能够集成PHP/Python等语言解释器. 文章这里解说怎样在l ...

  7. linux centos 7.5下 源码编译安装 lua环境

    lua 5.3.5 下载安装时发现缺少库 readline 需要添加依赖 yum search readline 看有哪些包 安装带有 devel 字样的 安装无 devel 的非开发包,通常不会自动 ...

  8. 已经编译安装的nginx/tenginx编译增加新模块

    只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...

  9. Nginx编译安装第三方模块http_substitutions_filter_module2222

    Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...

随机推荐

  1. 072_查看所有虚拟机磁盘使用量以及 CPU 使用量信息

    #!/bin/bashvirt-df #虚拟机磁盘使用量read -n1 "按任意键继续" keyvirt-top # CPU 使用量

  2. python3 中的bytes类型

  3. Django系列(二):Django的路由层,视图层和模板层

    1.Django的路由层 URL配置(URLconf)就像Django所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表:我们就是以这种方式告诉Django,对于客户端发来的某 ...

  4. WPS-系统缺失字体

    WPS-系统缺失字体 小书匠 linux  在Linux上新安装WPS后,第一次打开就出现以下问题: wps系统缺失字体 问题原因: Linux上缺少windows字体,把字体添加上去即可. 操作步骤 ...

  5. 6.Python3字符串和格式化

    一.字符串 1.字符串表示方法 2.字符串的序号 3.字符串的使用 4.字符串切片 5.字符串的特殊字符 6.字符串操作符 案例:输入对应的数字显示对应的星期 '''weekStr = "星 ...

  6. python 小数处理

    modf() 分别取整数部分和小数部分 math模块函数import mathn = 3.75print(math.modf(n))>>> (0.75, 3.0)n = 3.25pr ...

  7. 用win-acme给windows服务器添加SSL(Let's Encrypt)证书

    本文是我今天用win-acme给windows服务器添加SSL(Let's Encrypt)证书的一个过程,主要是给我自己备忘的. 1.首先先在github上下载最新版的win-acme. 下载地址: ...

  8. 关于JAVA线程池-ThreadPoolExecutor

    1. 源码翻译 /* * * * * * * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Grou ...

  9. Oracle 存储过程—为数传递变量

    oracle 存储过程的基本语法create or replace procedure proc1( p_para1 varchar2, p_para2 out varchar2, p_para3 i ...

  10. 艺赛旗RPA谷歌浏览器拾取

    rpa通过chrome拾取,操作步骤如下 方法一: 1>安装谷歌访问助手 直接下载:谷歌访问助手 官方下载地址:https://github.com/haotian-wang/google-ac ...