zoukankan      html  css  js  c++  java
  • macos系统安装nginx

    MacOS系统安装软件:


    macos系统下没有yum和apt-get命令,要安装软件需要使用homebrew。

    1、安装homebrew:

    安装:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    卸载:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

    PS:如果出现ping github.com超时的情况,查找第三方ip,如192.30.253.112 github.com添加到/etc/hosts最后一行。

    2、利用homebrew安装、卸载软件包:

    $ brew install pcre bzip2 openssl
    $ brew uninstall python
    $ brew search <packageName>
    $ brew list 查看已安装
    $ brew info <packageName> 查看包信息
    $ brew -v
    $ brew -h
    $ brew install nginx 安装过程会自己安装依赖关系
    $ brew services start nginx 启动nginx
    $ brew services stop nginx 关闭nginx
    $ brew services reload nginx 重启nginx
    $ brew uninstall nginx 卸载nginx

    3、nginx文件目录结构:

    nginx安装文件目录
    (...网站路径)
    /usr/local/Cellar/nginx


    nginx配置文件路径
    /usr/local/etc/nginx/nginx.conf


    nginx日志文件路径
    /usr/local/var/log/

    nginx运行pid文件路径
    /usr/local/var/run/

    系统hosts文件位置

    /private/etc/hosts

    4、其他

    注意事项:
    macos x系统对权限的约束非常严格,不能用root执行脚本;
    nginx.conf中user不能配置成root或macos,配置完会报错;
    运行时,目录属主:属组,属主需要改成conf中user的用户,默认nobody,属组改不了,默认staff(包含所有用户的组),
    但是即使如此,如果不配置属主,nginx并不生效,也就是说这个组没个卵用,目录配成777也没用。

  • 相关阅读:
    使用Webuploader大文件分片传输
    php面向对象的封装性
    前端实习经历
    Js_protoType_原型
    SVN客户端与服务器端搭建操作
    安装PL/SQL客户端来访问操作步骤
    安装Oracle数据库操作步骤
    MyEclipse2014安装操作步骤+破解
    模块学习笔记
    json与导入模块目录
  • 原文地址:https://www.cnblogs.com/immense/p/11397555.html
Copyright © 2011-2022 走看看