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. QT 5.4.1 for Android Windows环境搭建

    QT 5.4.1 for Android Windows环境搭建 2015-5-13 目录 一.参考文章: 二.准备软件: 三.安装准备好的软件: 四.配置Qt 5.4.1 for Android 五 ...

  2. 【其他】msb-lsb-intel-motorola大小端问题

    MSB(Most Significant Bit) 最高有效位: LSB(Least Significant Bit) 最低有效位 intel格式:低字节在前 Motorola格式:高字节在前 参考1 ...

  3. zookeeper 官方文档——综述

      Zookeeper: 一个分布式应用的分布式协调服务   zookeeper 是一个分布式的,开源的协调服务框架,服务于分布式应用程序.   它暴露了一系列基础操作服务,因此,分布式应用能够基于这 ...

  4. 20155237 2016-2017-2 《Java程序设计》第6周学习总结

    20155237 2016-2017-2 <Java程序设计>第6周学习总结 教材学习内容总结 第十章 输入与输出 InputStream与OutputStream 流(Stream)是对 ...

  5. PAT 团体程序设计天梯赛 L1-046 整除光棍(模拟除法)

    L1-046. 整除光棍 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 翁恺 这里所谓的"光棍",并不是指单身汪 ...

  6. CTF之常见的两种关于word的信息隐藏技术

    一.利用word本身自带的文字隐藏功能 1.在word中输入文字 2.选中文字,单击右键,选择字体选项 3.单击字体选项后,单击隐藏,确定 查找隐藏信息 1.单击左上角WPS文字后,选择选项按钮单击 ...

  7. HTML第二课——css【2】

    请关注公众号:自动化测试实战 现在继续上一节课的内容,看下面代码: <!DOCTYPE html><html><head>    <meta charset= ...

  8. microsoft webMatrix 使用 IISnode 进行node express 开发

    微软的microsoft webMatrix是一个免费的开发工具,我们可以使用它进行node 开发并利用iisnode 模块进行iis 的nodejs网站的维护,还是比较方便的. 一个简单的node ...

  9. 启用Win8/10(中文版/核心版/家庭版)中被阉割的远程桌面服务端

    Windows 8/8.1/10 标准版(中文版/核心版/家庭版)中取消了远程桌面服务端,想通过远程连接到自己的电脑就很麻烦了,第三方远程桌面速度又不理想(如TeamViewer).通过以下方法可让系 ...

  10. webpack 基本使用

    1. 创建webpack-test文件夹 2. npm初始化 3. 安装webpack 4. 使用webpack打包 hello.js 是需要打包的文件  hello.bundle.js 是打包完以后 ...