刚换电脑,实在不适应mac的各种操作和配置习惯

记录下流程方便以后查阅

1.安装brew 直接终端输入

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2.安装nginx

brew install nginx

3.这样nginx就安装好了,几个重要的路径

  • cd /usr/local/etc/nginx nginx配置文件的路径
  • cd /usr/local/Cellar/nginx/版本号 初始的html就在html里

4.开启nginx

sudo nginx

5.查看nginx运行状态

ps -ef|grep nginx

6.重新加载配置文件/关闭nginx

nginx -s reload/quit

访问的时候就看conf文件下listen的端口号,比如是80的话就访问localhost

碰到的问题

配置什么的没什么错误,但是运行显示nginx 403

权限问题

解决方法:文件夹–显示简介,查看文件夹的读写权限,都设置为可读可写,给没有用户的话添加上admin用户的权限。