brew services restart nginx

Stopping nginx... (might take a while)

==> Successfully stopped nginx (label: homebrew.mxcl.nginx)

==> Successfully started nginx (label: homebrew.mxcl.nginx)

但是实际上没启动成功,查看下错误日志

tail -n 10  /usr/local/var/log/nginx/error.log

2018/01/25 10:56:53 [emerg] 54933#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

2018/01/25 10:57:40 [emerg] 55281#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

2018/01/25 11:20:22 [emerg] 62763#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

2018/01/25 11:20:48 [emerg] 63020#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

查看看端口占用情况:

sudo lsof -i:80

没发现异常,突然想到之前安装过kong,会使用openresty,而openresty 又自带一个nginx,所以先卸载掉(准备使用minikube来运行kong)

但还是不行。

但是把80换成8080端口就可以,最后看到一篇文章(找不到链接了)里的方法搞定:

sudo chown root:wheel /usr/local/Cellar/nginx/1.12.2_1/bin/nginx
sudo chown root:wheel /usr/local/Cellar/nginx/1.12.2_1/bin/nginx

解决Mac nginx问题 [emerg] 54933#0: bind() to 0.0.0.0:80 failed (13: Permission denied)的更多相关文章

  1. Ubuntu nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

    在Ubuntu 12中启动刚安装好的Nginx,报错: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 原因如下: ...

  2. [运维] 如何解决 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

    环境: 虚拟机 linux centos 7 64 当时正在配置 nginx , 由于解压后的 nginx 默认安装位置是在 /usr/local/ 目录下, 而这个目录是 root 用户才有权限操作 ...

  3. nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

    启动nginx时报这个错 , 要么用root用户启动 , 要么在配置文件nginx.conf中将server下的listen端口改掉 , 因为在linux中端口号小于1024都是需要root权限的

  4. 解决nginx报错:nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied)

    报错描述: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) 通过ansible远程给主机更换端口并重新启动ng ...

  5. Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败

     Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied)     nginx 启动失败 ...

  6. nginx bind() to 0.0.0.0:**** failed (13: Permission denied)

    nginx 启动失败,日志里面报错信息如下: Starting nginx: nginx: [emerg] bind() to 0.0.0.0:**** failed (13: Permission ...

  7. 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect

    在进行Nginx+Tomcat 负载均衡的时候遇到了这个权限问题,在error.log日志中.我们能够看到例如以下: connect() to 127.0.0.1:8080 failed (13: P ...

  8. 解决nginx访问问题connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,

    问题:搭建好项目之后,用nginx进行代理,进行日常配置之后,发现前端正常访问,但是后端访问出现错误,报502错误,查找nginx日志,发现connect() to 127.0.0.1:8080 fa ...

  9. nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)

    现象 1.centos6.9 用rpm包安装nginx 2.修改Nginx的多个配置文件和配置项 3.service nginx restart 报错: nginx: [emerg] open() & ...

随机推荐

  1. ifstream 和 ofstream 用法。

    outfile << pContent;//不可以用这个,因为不能写完全,比如遇到字符串中出现/0就终止了 bool CTestEn_DecryptDLLDlg::WriteDataFil ...

  2. 使用MySQLTuner-perl对MySQL进行优化

    项目地址https://github.com/major/MySQLTuner-perl.git 抄一把说明,不翻译了,累-- MySQLTuner is a script written in Pe ...

  3. FZU 1202

    http://acm.fzu.edu.cn/problem.php?pid=1202 二分图最大匹配,问哪些边是必要的,O(n^3)的方法 删边的时候把连接关系也要删掉,如果在此基础上无法找到增广路, ...

  4. 前端开发 —— BOM

    0. BOM vs. DOM BOM:Browser Object Model,浏览器对象模型,是在 web 中使用 JavaScript 的绝对核心: BOM:提供了独立于内容而与浏览器窗口进行交互 ...

  5. Windows下C++删除清除map

    清除单map(非嵌套map) #include<map> #include<string> #include<iostream> using namespace s ...

  6. Tarjan+缩点【强连通分量】【模板】

    #include<iostream> #include<cstring> #include<algorithm> #include<queue> #in ...

  7. dfs、遍历与for

    dfs实际上就是若干个递归式连续使用,从而把所有情况全部遍历的方法 首先是递归式的连用,然后注意参数的选取以及变化就行了 1.参数一般有状态参数与开关参数 最简单的dfs就是每次选择只是改变自身状态( ...

  8. 【BZOJ2558】Count on a tree

    又是因为傻逼错误浪费了半天时间 原题: 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中lastans是上一个 ...

  9. 如何查看Eclipse的数字版的版本(转)

    为什么叫数字版的版本,因为Eclipse软件里显示的是文字版的版本,比如我现在的就是Version: Indigo Release.这在下载插件的时候很不方便. 如何查看文字版的版本信息:打开Ecli ...

  10. 多个sshkey 指定key来clone仓库

    Something like this should work (suggested by orip): ssh-agent bash -c 'ssh-add /somewhere/yourkey; ...