Mac OpenResty安装
参考网址:
http://openresty.org/cn/installation.html
1.安装前的准备 Mac OS X (Darwin) 用户
使用brew工具安装pcre、openssl库: brew install pcre openssl
2.下载 OpenResty的源码包l, 请到 Download 页下载
下载成功后解压openresty-1.9.15.1(版本号)
3. 使用终端,cd 到openresty-1.9.15.1目录下编译、安装openresty
(1)$ ./configure \
--with-cc-opt="-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/" \
--with-ld-opt="-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/" \
-j8
(2)make
(3)make install
4.安装完成后,openresty会安装到

5.启动openresty
sudo
/usr/local/openresty/nginx/sbin/nginx
6.指定配置文件启动openresty 指定一个工程目录
cd /Users/xinshaofeng/Study/
mkdir nginx
cd nginx
mkdir conf logs lua
cd conf
vi nginx.conf 把原来/usr/local/openresty/nginx/conf/nginx.conf内容拷贝进来
cd 到nginx目录下 cd /Users/xinshaofeng/Study/nginx
-c 指定配置文件 -p . 指定工程目录 . 当前目录 -s reload 修改配置文件后重启 -s stop 停止
pkill nginx 杀死nginx进程
ps -ef | grep nginx 查看nginx进程
sudo /usr/local/openresty/nginx/sbin/nginx -c conf/nginx.conf -p .
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步