LNMP=Linux+Nginx+Mysql+PHP

Install Nginx

//安装依赖包
# yum install openssl openssl-devel zlib-devel

//安装pcre
# wget http://exim.mirror.fr/pcre/pcre-8.01.tar.gz
# tar xf pcre-8.01.tar.gz -C /usr/local/web/
# cd /usr/local/web/pcre-8.01/
# ./configure 
# make ; make install

//安装libmd5
http://ftp.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/cryptography/libraries/libeay/
# tar xf libmd5-0.8.2b.tar.gz -C /usr/local/web/
# ls /usr/local/web/md5/
Makefile  asm  md5.c  md5.h  md5_dgst.c  md5_locl.h  md5_one.c  md5s.cpp  md5test.c  ranlib.sh

//安装Nginx
# wget http://nginx.org/download/nginx-1.10.1.tar.gz
# tar xf nginx-1.10.1.tar.gz -C /usr/local/web/
# cd /usr/local/web/nginx-1.10.1/
# useradd nginx
# id nginx
uid=502(nginx) gid=502(nginx) groups=502(nginx)
# ./configure   \ 
--user=nginx    \
--group=nginx   \
--with-http_realip_module  \ 
--with-http_stub_status_module  \
--with-http_gzip_static_module  \
--with-md5=/usr/local/web/md5  \
--with-sha1=auto/lib/sha1  \
--with-pcre=/usr/local/web/pcre-8.01  \
--without-select_module  \
--without-poll_module  \
--without-http_ssi_module  \
--without-http_userid_module  \
--without-http_geo_module  \
--without-http_map_module  \
--without-http_memcached_module \
--without-mail_pop3_module   \
--without-mail_imap_module   \
--without-mail_smtp_module   \
--prefix=/usr/local/nginx-1.10.1  
# make;make install
--with-http_realip_module 
此模块支持显示真实来源IP地址,主要用于NGINX做前端负载均衡服务器使用。

-with-http_stub_status_module 
这个模块可以取得一些nginx的运行状态, 

--with-http_gzip_static_module 
这个模块在一个预压缩文件传送到开启Gzip压缩的客户端之前检查是否已经存在以“.gz”结尾的压缩文件,这样可以防止文件被重复压缩。

--with-md5=/soft/md5/ 
设定md5库文件路径

--with-sha1=auto/lib/sha1 
设定sha1库文件路径
--with-pcre=/soft/pcre-8.01 
设定PCRE库路径

--without-select_module 
标准连接模式。默认情况下自动编译方式。您可以启用或禁用通过使用-select_module和不带- select_module配置参数这个模块

--without-poll_module 
不使用poll模块

--without-http_ssi_module 
不使用ngx_http_ssi_module模块,此模块处理服务器端包含文件(ssi)的处理.

--without-http_userid_module 
不使用ngx_http_userid_module模块

--without-http_geo_module 
这个模块基于客户端的IP地址创建一些ngx_http_geoip_module变量,并与MaxMindGeoIP文件进行匹配,该模块仅用于 0.7.63和0.8.6版本之后。但效果不太理想,对于城市的IP记录并不是特别准确,不过对于网站的来源访问区域的分析大致有一定参考性
。
--without-http_map_module 
不使用ngx_http_map_module模块

--without-http_memcached_module 
不使用ngx_http_memcached_module模块

--without-mail_pop3_module 
不允许ngx_mail_pop3_module模块

--without-mail_imap_module 
不允许ngx_mail_imap_module模块

--without-mail_smtp_module 
不允许ngx_mail_smtp_module模块
Ngnix编译参数详解

相关文章: