中文字幕亚洲一区,69久久久久精品9999不卡片,亚洲国产日韩欧美在线看片,国产精品久久久久久久久岛国

龍巖易富通網絡科技有限公司

龍巖小程序開發,龍巖分銷系統

CentOS-6.3安裝配置Nginx

2015.09.10 | 1336閱讀 | 0條評論 | 服務器配置

安裝說明

系統環境:CentOS-6.3 軟件:nginx-1.2.6.tar.gz 

安裝方式:源碼編譯安裝 

安裝位置:/usr/local/nginx 

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


安裝前提

在安裝nginx前,需要確保系統安裝了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


檢查系統安裝的Nginx:

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


卸載原有的Nginx

[root@admin /]# yum remove nginx


安裝

安裝前先升級ssl:http://www.co197.com/post/2629.html

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

[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 #添加配置項 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #重啟防火墻 [root@admin nginx-1.2.6]# service iptables restart


啟動

#方法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




停止

#查詢nginx主進程號 ps -ef | grep nginx 

#停止進程 kill -QUIT 主進程號 

#快速停止 kill -TERM 主進程號 

#強制停止 pkill -9 nginx




重啟

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


測試

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


三. 安裝過程中出現的問題 

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

原因是沒裝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++編譯器的相關package沒有安裝 

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


3.pcre:make時報錯:[pcrecpp.lo] Error 1 

原因是由于c++編譯器的相關package沒有安裝 

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


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   


文章來源:http://www.cnblogs.com/zhoulf/archive/2013/02/09/2909653.html


贊 (

發表評論

主站蜘蛛池模板: 耿马| 巩留县| 葫芦岛市| 寿宁县| 乌海市| 商洛市| 搜索| 桃园县| 栾川县| 铜山县| 周至县| 枣阳市| 宁城县| 微山县| 徐闻县| 建瓯市| 伊川县| 蒙自县| 专栏| 曲阜市| 全椒县| 洱源县| 桑日县| 新沂市| 丹凤县| 阿巴嘎旗| 仪征市| 尖扎县| 崇义县| 海宁市| 金华市| 三门县| 海淀区| 丹阳市| 大同县| 侯马市| 汉中市| 黄冈市| 大竹县| 东阿县| 新蔡县|