Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

第 36 章 Openresty

目录

36.1. 安装 Openresty
36.1.1. 源码安装
36.2. Openresty 开发
36.2.1. Hello world!!!
36.2.2. 日期和时间
36.2.3. 数据结构
36.2.4. echo 输出
36.2.5. 参数处理
36.2.6. Nginx 变量
36.2.7. Json
36.2.8. Redis
36.2.9. Nginx 缓存
36.2.10. logs
36.3. 实现灰度发布
36.4. Redis

36.1. 安装 Openresty

CentOS

		
wget https://openresty.org/package/centos/openresty.repo -O /etc/yum.repos.d/openresty.repo
		
		

RockyLinux

		
wget https://openresty.org/package/rocky/openresty.repo -O /etc/yum.repos.d/openresty.repo

或者

yum-config-manager --add-repo https://openresty.org/package/rocky/openresty.repo
		
		

安装

		
dnf install -y openresty		
		
		

36.1.1. 源码安装

			
dnf install pcre-devel openssl-devel gcc zlib-devel	
			
			
			
cd /usr/local/src
wget https://openresty.org/download/openresty-1.21.4.1.tar.gz
tar zxvf openresty-1.21.4.1.tar.gz 
cd openresty-1.21.4.1/
./configure --prefix=/srv/openresty-1.21.4.1
gmake
gmake install

ln -s /srv/openresty-1.21.4.1 /srv/openresty