本文共 2392 字,大约阅读时间需要 7 分钟。
OpenResty (又称 : ngx_openresty) 是一个基于 NGINX 的可伸缩的 Web 平台,可以使用 Lua脚本语言 调动 Nginx 支持的各种 C 以及 Lua 模块,OpenResty 性能优异。OpenResty 可以快速构造出 1W+ 并发连接响应的超高性能 Web 应用系统
OpenResty 可以将 Nginx+Lua 打包在一起,而且提供包括 Redis客户端,MySQL 客户端,http客户端等在内的大量的组件
# yum install readline-devel pcre-devel openssl-devel gcc # wget https://openresty.org/download/openresty-1.13.6.1.tar.gz # tar -zxvf openresty-1.13.6.1.tar.gz -C /opt/modules/ # cd /opt/modules/openresty-1.13.6.1 # cd bundle/LuaJIT-2.1-20171103 # make clean && make && make install ==== Successfully installed LuaJIT 2.1.0-beta3 to /usr/local ==== # 安装成功,且在 创建 /usr/local/bin/luajit 软连接 # cd /opt/modules/openresty-1.13.6.1/bundle # wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz # 在 下载最新稳定版 # cd /opt/modules/openresty-1.13.6.1/bundle # wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz # 在 下载最新稳定版 # 将 ngx_cache_purge nginx_upstream_check_module 进行打包编译在一起 # cd /opt/modules/openresty-1.13.6.1 # ./configure --prefix=/opt/modules/openresty --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 # cd /opt/modules/openresty drwxr-xr-x 2 root root 123 5月 10 20:02 bin -rw-r--r-- 1 root root 22924 5月 10 20:02 COPYRIGHT drwxr-xr-x 6 root root 56 5月 10 20:02 luajit drwxr-xr-x 6 root root 70 5月 10 20:02 lualib drwxr-xr-x 6 root root 54 5月 10 20:02 nginx drwxr-xr-x 44 root root 4096 5月 10 20:02 pod -rw-r--r-- 1 root root 218352 5月 10 20:02 resty.index drwxr-xr-x 5 root root 47 5月 10 20:02 site 错误: 无法验证 github.com 的由 “/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA” 颁发的证书: 颁发的证书还未生效。
可以再 wget 中增加 --no-check-certificate 参数,进行下载
# wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz --no-check-certificate # cd /opt/modules/openresty # ps -ef|grep nginx # 检查 nginx,发现 nginx 可以正常运行,说明 nginx 运行成功 root 23767 1 0 20:08 ? 00:00:00 nginx: master process ./sbin/nginx nobody 23768 23767 0 20:08 ? 00:00:00 nginx: worker process root 23771 6506 0 20:08 pts/5 00:00:00 grep --color=auto nginx 转载地址:http://uogab.baihongyu.com/