Tengine编译安装+lua+sticky模块
一.两个依赖包 有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
二.然后安装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模块的更多相关文章
- vim编译安装+lua模块
vim编译安装+lua模块 使用背景:代码自动补全插件,需要安装lua模块 安装准备,首先下载安装vim所依赖的其它安装包,ncurses,lua,readline,vim 源码下载,编译安装 ncu ...
- tengine编译安装及nginx高并发内核参数优化
Tengine Tengine介绍 Tengine是由淘宝网发起的Web服务器项目.它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性. Tengine的性能和稳定性已经在大型的 ...
- 编译安装带ssl 模块指定版本Python
出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries ...
- Nginx 最新版源码编译安装 包含常用模块作用及所需依赖
第一部分 Nginx最新版源码编译安装 1. 使用的模块 模块1:http_rewrite_module 基于正则匹配来实现重定向.依赖PCRE库,见依赖1 模块2:http_gzip_module ...
- 【01】Nginx:编译安装/动态添加模块
写在前面的话 说起 Nginx,别说运维,就是很多开发人员也很熟悉,毕竟如今已经 2019 年了,Apache 更多的要么成为了历史,要么成为了历史残留. 我们在提及 Nginx 的时候,一直在强调他 ...
- Linux下编译安装Apache及模块
Apache是时下最流行的Webserver软件之中的一个,支持多平台,可高速搭建web服务,并且稳定可靠.并可通过简单的API扩充.就能够集成PHP/Python等语言解释器. 文章这里解说怎样在l ...
- linux centos 7.5下 源码编译安装 lua环境
lua 5.3.5 下载安装时发现缺少库 readline 需要添加依赖 yum search readline 看有哪些包 安装带有 devel 字样的 安装无 devel 的非开发包,通常不会自动 ...
- 已经编译安装的nginx/tenginx编译增加新模块
只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...
- Nginx编译安装第三方模块http_substitutions_filter_module2222
Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...
随机推荐
- Spring AOP的作用,动态代理模式
AOP即面向切面编程.AOP是基于代理模式的. 代理模式: 当我们需要修改一个类,在类中加入代码时,为了不破坏这个类的封装性.可以使用代理模式,建立一个代理类. 比如:修改需求,在调用UserCont ...
- 三十九.NoSQL概述 部署Redis服务 、 部署LNMP+Redis
1. 搭建Redis服务器 在主机 192.168.4.50 上安装并启用 redis 服务 设置变量test,值为123 查看变量test的值 1.1 搭建redis服务器 1.1.1 安装re ...
- java.lang.OutOfMemoryError:PermGen space tomcat7 内存溢出
Tomcat 解决 在启动项目的时候,会报java.lang.OutOfMemoryError:PermGen space错误. 在tomcat/bin/catalina.sh windows li ...
- css添加了原始滚动条要隐藏滚动条的显示
// 添加伪类 <style> ::-webkit-scrollbar {display:none} </style> <div style=" width:2 ...
- radio回显的
JS回显 var jksp=document.getElementsByName("spjdcyModel.jksp"); // alert(jksp[0].value); //a ...
- Flutter移动电商实战 --(46)详细页_自定义TabBar Widget
主要实现详情和评论的tab provide定义变量 自己做一个tab然后用provide去控制 定义两个变量来判断是左侧选中了还是右侧选中了.并定义一个方法来接受参数,修改是左侧还是右侧选中的状态值 ...
- opencv 检测人脸、人眼
This tutorial code’s is shown lines below. You can also download it from here . The second version ( ...
- python socketpool:通用连接池
简介 在软件开发中经常要管理各种“连接”资源,通常我们会使用对应的连接池来管理,比如mysql数据库连接可以用sqlalchemy中的池来管理,thrift连接可以通过thriftpool管理,red ...
- PHP连接MySQL数据库的三种方式(mysql、mysqli、pdo)--续
2.PHP与Mysqli扩展,面向过程.对象 <?php $mysql_conf = array( 'host' => '127.0.0.1:3306', 'db' => 'test ...
- Qt编写自定义控件40-导航进度条
一.前言 导航进度条控件,其实就是支付宝.京东.淘宝订单页面的进度控件,提示当前第几步,总共有几步,然后当前进度特殊颜色显示,每个进度带有时间文字等信息,本控件特意将三种样式风格都集成进去了,京东订单 ...