龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開(kāi)發(fā),龍巖分銷(xiāo)系統(tǒng)

CentOS-6.3安裝配置Nginx

2015.09.10 | 1593閱讀 | 0條評(píng)論 | 服務(wù)器配置

安裝說(shuō)明

系統(tǒng)環(huán)境:CentOS-6.3 軟件:nginx-1.2.6.tar.gz 

安裝方式:源碼編譯安裝 

安裝位置:/usr/local/nginx 

下載地址:http://nginx.org/en/download.html


安裝前提

在安裝nginx前,需要確保系統(tǒng)安裝了g++、gcc、openssl-devel、pcre-devel和zlib-devel軟件。安裝必須軟件:


[root@admin /]#yum install gcc-c++ yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel


檢查系統(tǒng)安裝的Nginx:

[root@admin local]# find -name nginx ./nginx ./nginx/sbin/nginx ./nginx-1.2.6/objs/nginx


卸載原有的Nginx

[root@admin /]# yum remove nginx


安裝

安裝前先升級(jí)ssl:http://m.bmw-szbaoxin.cn/post/2629.html

將安裝包文件上傳到/usr/local中執(zhí)行以下操作:

[root@admin local]# cd /usr/local 

[root@admin local]# tar -zxv -f nginx-1.2.6.tar.gz 

[root@admin local]# rm -rf nginx-1.2.6.tar.gz 

[root@admin local]# mv nginx-1.2.6 nginx 

[root@admin local]# cd /usr/local/nginx 

[root@admin nginx]# ./configure --prefix=/usr/local/nginx  --with-http_ssl_module --with-openssl=指定源碼包所在的路徑

[root@admin nginx]# make 

[root@admin nginx]# make install



配置

#修改防火墻配置: [root@admin nginx-1.2.6]# vi + /etc/sysconfig/iptables #添加配置項(xiàng) -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #重啟防火墻 [root@admin nginx-1.2.6]# service iptables restart


啟動(dòng)

#方法1 [root@admin nginx-1.2.6]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

#方法2 [root@admin nginx-1.2.6]# cd /usr/local/nginx/sbin [root@admin sbin]# ./nginx




停止

#查詢(xún)nginx主進(jìn)程號(hào) ps -ef | grep nginx 

#停止進(jìn)程 kill -QUIT 主進(jìn)程號(hào) 

#快速停止 kill -TERM 主進(jìn)程號(hào) 

#強(qiáng)制停止 pkill -9 nginx




重啟

[root@admin local]# /usr/local/nginx/sbin/nginx -s reload


測(cè)試

#測(cè)試端口 netstat –na|grep 80 #瀏覽器中測(cè)試 http://ip:80


三. 安裝過(guò)程中出現(xiàn)的問(wèn)題 

1.pcre :/configure: error: no acceptable C compiler found in $PATH  See `config.log' for more details 

原因是沒(méi)裝gcc 

解決辦法:yum install gcc 


2../configure :checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables See `config.log' for more details. 

原因是由于c++編譯器的相關(guān)package沒(méi)有安裝 

解決辦法:yum install gcc-c++ 


3.pcre:make時(shí)報(bào)錯(cuò):[pcrecpp.lo] Error 1 

原因是由于c++編譯器的相關(guān)package沒(méi)有安裝 

解決辦法:yum install gcc-c++,重新configure,make && make install通過(guò)。 


4../configure: error: the HTTP rewrite module requires the PCRE library 

原因是需要PCRE library 

解決辦法:yum -y install pcre-devel 


5../configure: error: the HTTP cache module requires md5 functions from OpenSSL library.   You can either disable the module by using --without-http-cache option, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-http_ssl_module --with-openssl=<path> options. 

原因是需要OpenSSL library 

解決辦法:yum -y install openssl openssl-devel   


文章來(lái)源:http://www.cnblogs.com/zhoulf/archive/2013/02/09/2909653.html


贊 (

發(fā)表評(píng)論

主站蜘蛛池模板: 亚洲综合成人网| 综合自拍亚洲综合图不卡区| 2020国产精品亚洲综合网| 亚洲Av综合色区无码专区桃色| 色欲天天天综合网| 亚洲国产综合精品中文第一| 国产成人综合亚洲欧美天堂| 狠狠色狠狠色综合伊人| 欧美久久综合性欧美| 亚洲国产婷婷综合在线精品| 色综合合久久天天综合绕视看| 91精品国产综合久久四虎久久无码一级| 狠狠色丁香久久综合五月| 久久久久亚洲AV综合波多野结衣| 99热婷婷国产精品综合| 炫硕日本一区二区三区综合区在线中文字幕| 人妻 日韩 欧美 综合 制服| 2021精品国产综合久久| 色综合天天综合| 一个色综合久久| 久久国产综合精品五月天| 狠狠色噜噜狠狠狠狠色综合久AV| 久久婷婷激情综合色综合俺也去| 色狠狠色狠狠综合一区| 色88久久久久高潮综合影院| 久久综合亚洲鲁鲁五月天| 亚洲欧美日韩国产综合在线| 色婷婷综合在线| 久久综合香蕉国产蜜臀AV| 综合亚洲欧美三级| 久久综合狠狠综合久久激情 | 久久综合九色综合久99| 日本伊人色综合网| 亚洲综合久久综合激情久久| 天天影视色香欲综合久久| 伊人色综合九久久天天蜜桃| 天天综合网网欲色| 亚洲av综合色区| 国产成人99久久亚洲综合精品| 五月六月综合欧美网站| 久久久综合香蕉尹人综合网|