美文网首页
Mac Nginx 部署(不推荐,docker更方便)

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

作者: Sunnky | 来源:发表于2018-11-05 16:56 被阅读0次

    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更方便)

          本文链接:https://www.haomeiwen.com/subject/vogsxqtx.html