当前位置:   article > 正文

mac安装nginx

mac安装nginx

mac系统经常采用brew安装软件

1、判断mac电脑是否已安装brew

brew update

2、如果没有安装brew,可以进入官网安装,官网安装会走国外服务器,需要vpn,也可以用国内版本安装

官网地址:https://brew.sh/index_zh-cn.html

官网安装命令:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

国内版本:(根据提示选择安装下载镜像、执行脚本选择Y)

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

3、查询需要安装的nginx包是否存在

brew search nginx

4、安装nginx

brew install nginx

5、安装成功后,查看nginx安装目录

brew info nginx

服务目录:open /usr/local/var/www

配置目录:open /usr/local/etc/nginx

6、启动nginx,没有报错,则启动成功,打开浏览器,访问 http://localhost:8080/

nginx

7、nginx常用操作

重启:nginx -s reload

关闭:nginx -s stop

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/264500
推荐阅读
相关标签
  

闽ICP备14008679号