微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Centos7.2 OpenResty安装

产考博文

安装顺序

1,创建安装目录

mkdir -p /usr/servers  
cd /usr/servers/

2,安装依赖

yum install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl  readline-devel pcre-devel openssl-devel gcc

3,下载最新版的ngx_openresty

wget https://openresty.org/download/openresty-1.11.2.3.tar.gz
tar -xzvf openresty-1.11.2.3.tar.gz

4,安装LuaJIT

cd openresty-1.11.2.3/bundle/LuaJIT-2.1-20170405
make clean && make && make install
ln -sf LuaJIT-2.1-20170405 /usr/local/bin/luajit

5 下载ngx_cache_purge模块

该模块用于清理Nginx缓存

cd /usr/servers/openresty-1.11.2.3/bundle  
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz  
tar -xvf 2.3.tar.gz

6 下载Nginx_upstream_check_module模块

该模块用于ustream健康检查

cd /usr/servers/openresty-1.11.2.3/bundle  
wget https://github.com/yaoweibin/Nginx_upstream_check_module/archive/v0.3.0.tar.gz  
tar -xvf v0.3.0.tar.gz

7 安装 OpenResty

cd /usr/servers/openresty-1.11.2.3  
./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 
make && make install

其他

  1. 核心和第三方模块目录 openresty-1.11.2.3/bundle

原文地址:https://www.jb51.cc/centos/376983.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。