<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nginx on 菜鸟程序员</title><link>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/nginx/</link><description>Recent content in Nginx on 菜鸟程序员</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/nginx/index.xml" rel="self" type="application/rss+xml"/><item><title>安装Nginx</title><link>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/nginx/%E5%AE%89%E8%A3%85nginx/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/nginx/%E5%AE%89%E8%A3%85nginx/</guid><description>&lt;h2 id="apt安装推荐">apt安装（推荐）&lt;a class="td-heading-self-link" href="#apt%e5%ae%89%e8%a3%85%e6%8e%a8%e8%8d%90" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>一行命令： &lt;code>sudo apt install nginx&lt;/code>
其他命令&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-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>sudo systemctl status nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl start nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl stop nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl restart nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl &lt;span style="color:#204a87">enable&lt;/span> nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl disable nginx
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="源码安不推荐">源码安（不推荐）&lt;a class="td-heading-self-link" href="#%e6%ba%90%e7%a0%81%e5%ae%89%e4%b8%8d%e6%8e%a8%e8%8d%90" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>github地址： &lt;a href="https://github.com/nginx/nginx">https://github.com/nginx/nginx&lt;/a>&lt;/p>
&lt;p>我是一个菜鸟，本着能用就别折腾的原则。能用apt（yum） 就用apt（yum）
除非你是要处于一个学习的目的或者需要二次开发。&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-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># 添加用户组和用户&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>groupadd nginx
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>useradd -r -g nginx nginx -s /sbin/nologin
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># 源码安装三板斧&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>./configure --prefix&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>/usr/local/nginx --user&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>nginx --group&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>nginx --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>make
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>make install 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>chown -R nginx.nginx /usr/local/nginx/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87">cd&lt;/span> /usr/local/nginx/sbin/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># 启动&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>./nginx
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>