yum安装OpenResty

一、安装openresty

1.添加仓库执行命令

 yum install yum-utils

在这里插入图片描述

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

在这里插入图片描述

2.执行安装

yum install openresty

在这里插入图片描述

3.安装成功后 会在默认的目录如下

cd /usr/local/openresty

在这里插入图片描述

二、安装nginx

默认已经安装好了nginx,在目录:/usr/local/openresty/nginx 下。

修改/usr/local/openresty/nginx/conf/nginx.conf,将配置文件使用的根设置为root,目的就是将来要使用lua脚本的时候 ,直接可以加载在root下的lua脚本。

cd /usr/local/openresty/nginx/conf
vi nginx.conf

在这里插入图片描述

三、启动

cd /usr/local/openresty/nginx/sbin
./nginx
http://192.168.1.133/

在这里插入图片描述