【MAC】OpenResty安装

首先官方网站:http://openresty.org/cn/download.html

安装:

我是安装官网去执行的安装命令

配置环境变量

powershell 复制代码
1.打开配置文件
vim ~/.bash_profile

2.粘贴进去变量配置
#OPENRESTY
export NGINX_HOME=/opt/homebrew/etc/openresty
export PATH=$PATH:$NGINX_HOME/sbin

3.刷新配置
source ~/.bash_profile

测试1

powershell 复制代码
查看是否安装成功:
nginx -v
openresty -v

测试2

在nginx.conf配置中加入下面代码

powershell 复制代码
  server {
        #监听端口,若你的6699端口已经被占用,则需要修改
        listen 6699;
    server_name localhost;
        location / {
            default_type text/html;

            content_by_lua_block {
                ngx.say("HelloWorld")
            }
        }
    }

启动和关闭

powershell 复制代码
openResty的启动和停止:(要在配置文件目录下)

启动:openresty -p `pwd` -c nginx.conf 

停止:openresty -s quit -p `pwd` -c nginx.conf
相关推荐
Fine姐1 分钟前
传感器WSNs TheDataLinkLayer——X-MAC
macos
初级代码游戏17 小时前
Maui劝退:用windows直接真机调试iOS,无须和Mac配对
macos·ios·配置·maui·热重载
草巾冒小子20 小时前
Mac如何连接惠普M126a打印机(教程篇)
macos
蒙小萌19931 天前
苹果UI 设计
macos·ui·cocoa
用户49055816081251 天前
Homebrew 简介
macos
可曾去过倒悬山1 天前
mac电脑的usr/libexec目录是干什么的?
macos
罗技1231 天前
高版本的MacOS如何降级?
macos
咕噜签名分发冰淇淋1 天前
申请注册苹果iOS企业级开发者证书需要公司拥有什么规模条件
macos·ios·cocoa
尽兴-2 天前
如何将多个.sql文件合并成一个:Windows和Linux/Mac详细指南
linux·数据库·windows·sql·macos
诗句藏于尽头2 天前
Mac关闭触控板
macos