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

第 2 章 Openresty

目录

2.1. 安装 Openresty
2.1.1. 源码安装
2.2. Openresty 开发
2.2.1. Hello world!!!
2.2.2. 日期和时间
2.2.3. 数据结构
2.2.4. echo 输出
2.2.5. 参数处理
2.2.6. Nginx 变量
2.2.7. Json
2.2.8. Redis
2.2.9. Nginx 缓存
2.2.10. logs
2.3. 实现灰度发布
2.4. Redis

2.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		
		
		

2.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