首页 > 代码库 > nginx安装及其配置(Centos6.8)

nginx安装及其配置(Centos6.8)

nginx第三方模块下载地址:

https://www.nginx.com/resources/wiki/modules/

nginx地址下载:

http://nginx.org/en/download.html


./configure  \                                                                  
    --prefix=/usr/local/mybin/nginx \   #将编译好的nginx放置在这个nginx目录下面.
    --with-http_random_index_module \
    --with-http_ssl_module \
    --with-http_realip_module \
    --with-http_addition_module \
    --with-http_sub_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_gzip_static_module \
    --with-http_geoip_module \
    --add-module=/usr/local/mysrc/nginx-3rd/nginx-module-url \ #url
    --add-module=/usr/local/mysrc/nginx-3rd/nginx-upstream-fair \ #fair
    --add-module=/usr/local/mysrc/nginx-3rd/ngx_cache_purge \ #缓冲
    --add-module=/usr/local/mysrc/nginx-3rd/ngx_http_consistent_hash  #ip_hash



其中可能报错误,pcre library找不到,下载pcre-devel就可以了

还可能报错误,geoip library找不到,下载geoip-devel就可以了,这个rpm包有可能yum下载找不到,

则需要配置epel源 ,如下

rpm -ivh http://dl.fedoraproject.org/pub/ ... ease-5-4.noarch.rpm

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

这样源就配置好了


本文出自 “12208412” 博客,请务必保留此出处http://12218412.blog.51cto.com/12208412/1872959

nginx安装及其配置(Centos6.8)