Nginx安裝

一、必要軟件準備

  • 安裝pcre

爲了支持rewrite功能,咱們須要安裝pcrehtml

 

  • 安裝openssl

須要ssl的支持,若是不須要ssl支持,請跳過這一步nginx

 

二、安裝nginx

執行以下命令:web

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

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

最後輸出以下內容,表示configure OK了。
.....ide

 

三、啓動、關閉、重置nginx

啓動:直接執行如下命令,nginx就啓動了,不須要改任何配置文件,nginx配置多域名虛擬主機請參考後續文章.google

試試訪問:我這邊不貼圖,直接使用curl命令來讀取web信息url

[root@ns conf]# curl -s http://localhost | grep nginx.com
nginx.com.

關閉:spa

重置:當你有修改配置文件的時候,只須要reload如下便可code

整個nginx的安裝就到這裏結束了。

出處:http://www.ttlsa.com/html/1548.html

相關文章
相關標籤/搜索