Niginx 下載與安裝
1、下載
<code>wget http://nginx<span>.org</span>/download/nginx-<span>1.10</span><span>.0</span><span>.tar</span><span>.gz</span></code>
我的軟體都下載到了 /opt/soft-install 下
2、解壓
<code><span>#解压到当前目录</span> tar -zxvf nginx-<span>1.10</span><span>.0</span><span>.tar</span><span>.gz</span> -C .</code>
2、解壓
首先得了解下面幾個指令的意義
參考:http://feinibuke.blog.51cto.com/1724260/367376
安裝到/opt/soft/nginx-1.10.0 目錄下
<code><span>cd</span> nginx-<span>1.10</span>.<span>0</span>/ <span># 指定安装到 /opt/soft/ngnix 的目录下</span> ./configure --prefix=/opt/soft/nginx-<span>1.10</span>.<span>0</span></code>
提示:缺少Crr
繼續configure提示:缺少pcre依賴庫
解決
<code><span>yum</span><span>install</span><span>gcc</span><span>gcc</span><span>-</span><span>c</span><span>+</span><span>+</span></code>
<code>yum <span>install</span> pcre pcre-devel</code>
<code>yum <span>install</span> zlib zlib-devel</code>
如果看的以下目錄結構,說明基本安裝沒問題了
啟動Nginx
<code>yum <span>install</span> gcc gcc-c++ yum <span>install</span> pcre pcre-devel yum <span>install</span> zlib zlib-devel</code>
將80埠開放
<code><span>make</span> & <span>make</span> install</code>
瀏覽器存取192.168.2.202
出現以上介面,說明Nginx存取成功。 Niginx 常用指令1、查看Nginx進程<code><span>cd</span> /opt/soft/nginx-<span>1.10</span>.<span>0</span>/ ./sbin/nginx</code>
2、查看Nginx指令
<code><span>firewall</span><span>-</span><span>cmd</span><span>-</span><span>-</span><span>z/span><span>-</span><span>-</span><span>add</span><span>-</span><span>port=80/tcp</span><span>-</span><span>-</span><span>permanent</span><span>firewall</span><span>-</span><span>cmd</span><span>-</span><span>-</span><span>reload</span></span></code>
').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介紹了CentOS7 編譯安裝Nginx,包含了centos7方面的內容,希望對PHP教學有興趣的朋友有幫助。