编程技术分享平台

网站首页 > 技术教程 正文

Mac中通过brew安装Nginx(mac安装webpack)

xnh888 2024-10-12 13:53:21 技术教程 18 ℃ 0 评论

一、安装

mac电脑还没安装的brew,传送门:在mac下正确快速安装brew

运行如下命令:

brew install nginx


二、Nginx相关

1.启动nginx

brew services start nginx


验证:


2.关闭nginx

brew services stop nginx


验证:


3.查看nginx文件

open /usr/local/Cellar/nginx

弹出安装目录


open /usr/local/etc/nginx

弹出配置目录

cat /usr/local/etc/nginx/nginx.conf

可见conf配置

三、nginx命令


nginx -s reload 重新加载配置
nginx -s reopen 重启
nginx -s stop 停止
nginx -s quit 退出
nginx -V 查看版本,以及配置文件地址
nginx -v 查看版本
nginx -c filename 指定配置文件
nginx -h 帮助

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表