码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-11-15 21:06:58      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:安装   nginx   

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)

标签:安装   nginx   

原文地址:http://12218412.blog.51cto.com/12208412/1872959

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!