mac nginx的安装

http://blog.csdn.net/happyheng/article/details/63683513

在mac上进行安装:

  1、使用homebrew进行安装:

    brew install nginx

  其会安装在 /usr/local/Cellar/目录下。

  2、给予管理员权限

    sudo chown root:wheel/usr/local/opt/nginx/bin/nginx

    sudo chmod u+s/usr/local/opt/nginx/bin/nginx

  3、修改其监听端口为80:

    sudo vim /usr/local/etc/nginx/nginx.conf

  然后在里面的

    server {

        listen       8080;

        server_name  localhost;

        xxx

    }

  将listen对应的8080改为80即可,保存退出

  4、启动nginx:

  直接在终端中执行:

    sudo nginx

  因为之前已经修改了端口号,所以直接输入localhost,既可以看到欢迎信息:

  5.重新加载nginx.conf文件:

    sudo nginx -s reload

  6.退出nginx:

    sudo nginx -s quit

你可能感兴趣的:(mac nginx的安装)