<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux on 菜鸟程序员</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/</link><description>Recent content in Linux on 菜鸟程序员</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>报错处理</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/%E6%8A%A5%E9%94%99%E5%A4%84%E7%90%86/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/%E6%8A%A5%E9%94%99%E5%A4%84%E7%90%86/</guid><description>&lt;h2 id="启动nginx-bind-to-000080-failed-13-permission-denied">启动nginx bind() to 0.0.0.0:80 failed (13: Permission denied)&lt;a class="td-heading-self-link" href="#%e5%90%af%e5%8a%a8nginx-bind-to-000080-failed-13-permission-denied" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>第一种 端口号小于 1024&lt;/p>
&lt;pre tabindex="0">&lt;code>
原因是1024以下端口启动时需要root权限，所以sudo nginx即可
&lt;/code>&lt;/pre>&lt;p>第二种：端口大于1024的情况：
首先，查看http允许访问的端口：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>semanage port -l &lt;span style="color:#000;font-weight:bold">|&lt;/span> grep http_port_t
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, &lt;span style="color:#0000cf;font-weight:bold">9000&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># 这里的原因是selinux的权限配置问题导致的&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>semanage port -a -t http_port_t -p tcp &lt;span style="color:#0000cf;font-weight:bold">8090&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>