Mac Nginx 部署(不推荐,docker更方便)

mac下通过 brew 安装 nginx
安装完以后,可以在终端输出的信息里看到一些配置路径:
/usr/local/etc/nginx/nginx.conf (配置文件路径)
/usr/local/var/www (服务器默认路径)
/usr/local/Cellar/nginx/1.12.1(安装路径)

1.查询nginx是否启动
ps -ef|grep nginx

2.查询nginx的配置路径:

nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

3.nginx服务路径:
/usr/local/Cellar/nginx/1.12.1/bin

4.验证配置文件是否正确

nginx -t -c /usr/local/etc/nginx/nginx.conf
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

5.nginx启动 重启

./nginx
./nginx -s reload

mac下通过 brew 安装nginx
安装完以后,可以在终端输出的信息里看到一些配置路径:

/usr/local/etc/nginx/nginx.conf (配置文件路径)
/usr/local/var/www (服务器默认路径)
/usr/local/Cellar/nginx/1.12.1(安装路径)

你可能感兴趣的:(Mac Nginx 部署(不推荐,docker更方便))