Mac下安装Nginx
当前环境 10.13
安装工具:
homebrew(还没用过的小伙伴可以点链接进行了解或者自行百度)
安装步骤:
1、打开终端,习惯性命令:
Bash
brew update // 更新brew
2、终端继续执行命令:
Bash
brew search nginx // 查询要安装的软件是否存在
3、查看需要安装nginx的信息
有助于后面理解:
Bash
brew info nginx
我们可以看到,nginx在本地还未安装(Not installed),nginx的来源(From)
Docroot默认为/usr/local/var/www
,在/usr/local/etc/nginx/nginx.conf
配置文件中默认端口被配置为8080,从而使nginx运行时不需要加sudo
,nginx将在/usr/local/etc/nginx/servers/
目录中加载所有文件,以及