openresty安装在ubuntu下的安装

参考 安装OpenResty(Nginx+Lua)开发环境

安装步骤:

# 创建目录/usr/servers,以后我们把所有软件安装在此目录
mkdir -p /usr/servers
cd /usr/servers/ # 安装依赖
apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl # 下载ngx_openresty-1.7.7.2.tar.gz并解压
wget http://openresty.org/download/ngx_openresty-1.7.7.2.tar.gz
tar -xzvf ngx_openresty-1.7.7.2.tar.gz # 安装LuaJIT
cd /usr/servers/ngx_openresty-1.7.7.2/bundle/LuaJIT-2.1-20150120/ # 没有安装make的需要先安装
apt install make
apt install make-guile # 没安装gcc的需要先执行以下命令
sudo apt-get build-dep gcc make clean && make && make install
ln -sf luajit-2.1.0-alpha /usr/local/bin/luajit # 下载ngx_cache_purge模块,该模块用于清理nginx缓存
cd /usr/servers/ngx_openresty-1.7.7.2/bundle
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
tar -xvf 2.3.tar.gz # 下载nginx_upstream_check_module模块,该模块用于ustream健康检查
cd /usr/servers/ngx_openresty-1.7.7.2/bundle
wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
tar -xvf v0.3.0.tar.gz # 安装ngx_openresty
cd /usr/servers/ngx_openresty-1.7.7.2
./configure --prefix=/usr/servers --with-http_realip_module --with-pcre --with-luajit --add-module=./bundle/ngx_cache_purge-2.3/ --add-module=./bundle/nginx_upstream_check_module-0.3.0/ -j2
# 报错 checking for zlib library ... not found,需要安装 zlib
sudo apt-get install zlib1g-dev
make && make install
# 报错 recipe for target 'objs/src/event/ngx_event_openssl.o' failed,openssl版本问题,需要安装旧版本
# 需要指定旧版本,推荐在编译 Nginx 时指定 OpenSSL 源码目录,而不是使用系统自带的版本,这样更可控
cd /usr/servers/ngx_openresty-1.7.7.2/bundle
wget -O openssl.tar.gz -c https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz
tar zxf openssl.tar.gz
mv openssl-OpenSSL_1_0_2k/ openssl
# 重新配置 ngx_openresty
cd /usr/servers/ngx_openresty-1.7.7.2
./configure \
--prefix=/usr/servers \
--with-http_realip_module \
--with-pcre \
--with-luajit \
--add-module=./bundle/ngx_cache_purge-2.3/ \
--add-module=./bundle/nginx_upstream_check_module-0.3.0/ \
--with-openssl=./bundle/openssl \
-j2
# 重新make
make && make install # 启动nginx,访问 http://localhost/ 成功即可
/usr/servers/nginx/sbin/nginx

拓展:

  1. ubuntu gcc 安装 使用
  2. ubantu下安装zlib的方法
  3. Nginx 配置之完整篇

openresty安装笔记的更多相关文章

  1. openresty 学习笔记一:环境安装

    openresty 学习笔记一:环境安装 openresty 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭 ...

  2. openresty 学习笔记五:访问RabbitMQ消息队列

    openresty 学习笔记五:访问RabbitMQ消息队列 之前通过比较选择,决定采用RabbitMQ这种消息队列来做中间件,目的舒缓是为了让整个架构的瓶颈环节.这里是做具体实施,用lua访问Rab ...

  3. openresty 学习笔记二:获取请求数据

    openresty 学习笔记二:获取请求数据 openresty 获取POST或者GET的请求参数.这个是要用openresty 做接口必须要做的事情.这里分几种类型:GET,POST(urlenco ...

  4. MonoDevelop 4.2.2/Mono 3.4.0 in CentOS 6.5 安装笔记

    MonoDevelop 4.2.2/Mono 3.4.0 in CentOS 6.5 安装笔记 说明 以root账户登录Linux操作系统,注意:本文中的所有命令行前面的 #> 表示命令行提示符 ...

  5. mac下openresty安装

    //openresty安装 http://openresty.org/ brew updatebrew install pcre openssl ./configure --prefix=/usr/l ...

  6. 基于Ubuntu14.04系统的nvidia tesla K40驱动和cuda 7.5安装笔记

    基于Ubuntu14.04系统的nvidia tesla K40驱动和cuda 7.5安装笔记 飞翔的蜘蛛人 注1:本人新手,文章中不准确的地方,欢迎批评指正 注2:知识储备应达到Linux入门级水平 ...

  7. sublime 安装笔记

    sublime 安装笔记 下载地址 安装package control 根据版本复制相应的代码到console,运行 按要求重启几次后再按crtl+shift+p打开命令窗口 输入pcip即可开始安装 ...

  8. docker在ubuntu14.04下的安装笔记

    本文主要是参考官网教程进行ubuntu14.04的安装. 下面是我的安装笔记. 笔记原件完整下载: 链接: https://pan.baidu.com/s/1dEPQ8mP 密码: gq2p

  9. ArchLinux 安装笔记:续 --zz

    续前话 在虚拟机里调试了几天,终于鼓起勇气往实体机安装了,到桌面环境为止的安装过程可以看我的前一篇文章<ArchLinux 安装笔记>.桌面环境我使用的是 GNOME,虽然用了很长一段时间 ...

随机推荐

  1. c# 获取sqlserver 运行脚本的print消息的方法分享

    转自:http://www.maomao365.com/?p=6923  摘要: 在sql脚本的编写中,我们经常使用sql脚本print消息,作为输出测试, 通过获取print消息,我们可以快速获取程 ...

  2. 【tf.keras】Resource exhausted: OOM when allocating tensor with shape [9216,4096] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc

    运行以下类似代码: while True: inputs, outputs = get_AlexNet() model = tf.keras.Model(inputs=inputs, outputs= ...

  3. AJAX 实现form表单提交

    1.使用Ajax实现异步操作,点击登录按钮后,即触发form表单的提交事件,数据传输至后端 JSP: <script type="text/javascript" src=& ...

  4. vscode源码分析【五】事件分发机制

    第一篇: vscode源码分析[一]从源码运行vscode 第二篇:vscode源码分析[二]程序的启动逻辑,第一个窗口是如何创建的 第三篇:vscode源码分析[三]程序的启动逻辑,性能问题的追踪 ...

  5. java之运算符的优先级

    优先级 运算符 结合性 1 () [] 从左往右 2 ! +(正) -(负) ++ -- 从右往左 3 * / %  从左往右 4 << >> >>> 从左往 ...

  6. python-15-常用文件操作与注册登录练习

    前言 1.常用的文件操作无非就是读或写,但python中没有提供文件修改的功能,是无法实现,但我们可以新增-删除源文件-更改新增文件为源文件名称. 2.使用文件的存储与读取方式来简单完成注册.登录功能 ...

  7. ExtJS布局控件

    Layout Controls Auto Layout Ext JS4中的容器的默认布局是自动布局.这个布局管理器会自动地将组件放在一个容器中. Fit Layout Fit布局安排了容器的内容完全占 ...

  8. 打开Github网站反应慢的问题

    解决办法: 为了提高速度,可以使用HOSTS加速对Github网站加载的资源网站域名解析. 具体做法: 修改  C:\Windows\System32\drivers\etc  中的hosts文件(P ...

  9. 安全NA第一天笔记:Firewall基本理论

    防火墙的三种类型:<1>包过滤(packet filtering):也就是我们常用的访问控制列表(ACL)1.ACL类型:标准,扩展,命名,自反2.ACL其他特性:(1)重新排列序列号:  ...

  10. gRPC+gRPC Gateway+swagger小记

    前言 本文记录了grpc-gateway的简单使用. 定义proto 先来看看最常规的 syntax = "proto3"; package protos; service Gre ...