Centos7.0安裝Nginx1.8.1

Centos7.0安裝Nginx1.8.1

一、安裝Nginx依賴包

系統環境是Centos7.0

spacer.gif

#yum –y install  pcre-devel

#yum –y install openssl-devel

#yum –y install gcc

#./configure --prefix=/usr/local/nginx --with-http_ssl_module--with-http_spdy_module --with-http_stub_status_module --with-pcre

註釋:

//--with-http_stub_status_module:支持nginx狀態查詢--with-http_ssl_module:支持https
--with-http_spdy_module
:支持googlespdy,想了解請百度spdy,這個必須有ssl的支持
--with-pcre
:爲了支持rewrite重寫功能,必須制定pcre

1.gcc-----------------必不可少的

2.zlib-----------------gzip需要

3.openssl(包括openssl-devel)-----SSL支持需要

4.pcre(包括pcre-devel)----讓nginx支持正則表達式

#make

#make install

2、啓動服務

#/usr/local/nginx-1.8.1/sbin/nginx

注意:

1)客戶機測試需把Nginx服務器防火牆關閉

#service firewalld stop

2)如果修改配置文件則需要重新啓動服務,

#/usr/local/nginx-1.8.1/sbin/nginx –s reload

spacer.gif

 

 

 

 

 

 

 

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章