0
点赞
收藏
分享

微信扫一扫

yum安装OpenResty

艾晓雪 2023-08-01 阅读 55

安装系统为CentOS 8.0.1905

1. 安装开发库依赖

yum install -y pcre-devel openssl-devel gcc

yum install -y pcre-devel openssl-devel gcc --skip-broken

2. 配置yum的依赖源

添加OpenResty仓库

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

命令不存在,则运行yum install -y yum-utils

3. 安装OpenResty

yum install -y openresty

默认情况下,OpenResty安装的目录是:/usr/local/openresty

4. 修改配置文件

vim /usr/local/openresty/nginx/conf/nginx.conf

server {

listen 7000; 监听端口

}

5. 配置环境变量

vim /etc/profile

# 添加至文件
export NGINX_HOME=/usr/local/openresty/nginx
export PATH=${NGINX_HOME}/sbin:$PATH

# 配置生效
source /etc/profile

6. 启动OpenResty(Nginx)

/usr/local/openresty/nginx/sbin/nginx
或
service openresty start
或
nginx

7. 浏览器查看Nginx的页面

yum安装OpenResty_nginx

举报

相关推荐

0 条评论