Nginx需要依赖下面3个包
依赖包一键安装:
<code>yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel yum -y groupinstall <span>"Development Tools"</span><span>"Development Libraries"</span> 此命令可以一键安装开发工具包</code>
源码安装:
<code>openssl: tar -xzvf openssl-<span>1.0</span><span>.1</span><span>.tar</span><span>.gz</span> cd openssl-<span>1.0</span><span>.1</span> ./config(注意) && make && make install <span>pcre:</span> tar -xzvf pcre-<span>8.21</span><span>.tar</span><span>.gz</span> cd pcre-<span>8.21</span> ./configure && make && make install <span>zlib:</span> tar -xzvf zlib-<span>1.2</span><span>.8</span><span>.tar</span><span>.gz</span> cd zlib-<span>1.2</span><span>.8</span> ./configure && make && make install</code>
nginx安装命令: nginx各个版本下载地址:http://nginx.org/download/
<code>#注意 \ 前面至少一个有空格 ./configure --prefix=/home/renwh/nginx -<span>-with-http_ssl_module \ </span>-<span>-with-pcre=../pcre-<span>8.21</span> \ <span>#指向解压的源码目录</span></span>-<span>-with-zlib=../zlib-<span>1.2</span>.<span>8</span> \ <span>#指向解压的源码目录</span></span>-<span>-with-openssl=../openssl-<span>1.0</span>.<span>1</span> \ <span>#指向解压的源码目录</span></span></code>
注:编译好的nginx可以通过 /home/renwh/nginx -V (具体路径以安装的为主) 查看编译时候的参数
然后只需要make,make install 即可。
参考链接:http://www.cnblogs.com/siqi/p/3572695.html
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了nginx 安装手记,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。