国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

Linux下nginx編譯安裝教程和編譯參數詳解

2024-08-30 12:27:05
字體:
來源:轉載
供稿:網友

一、必要軟件準備
1.安裝pcre

為了支持rewrite功能,我們需要安裝pcre
代碼如下:# yum install pcre* //如過你已經裝了,請跳過這一步

2.安裝openssl

需要ssl的支持,如果不需要ssl支持,請跳過這一步
代碼如下:# yum install openssl*

3.gzip 類庫安裝

代碼如下:yum install zlib zlib-devel

4.安裝wget

下載nginx使用,如果已經安裝,跳過這一步
代碼如下:# yum install wget

二、安裝nginx

1.下載
代碼如下:wget http://nginx.org/download/nginx-1.7.0.tar.gz
2.解壓
代碼如下:
tar -zxvf nginx-1.7.0.tar.gz

3.編譯和安裝
執行如下命令:
代碼如下:
# cd nginx-1.7.0
# ./configure --prefix=/usr/local/nginx-1.7.0 /
--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:支持google的spdy,想了解請百度spdy,這個必須有ssl的支持
–with-pcre:為了支持rewrite重寫功能,必須制定pcre

最后輸出如下內容,表示configure OK了。

代碼如下:
checking for zlib library ... found
 creating objs/Makefile
Configuration summary
 + using system PCRE library
 + using system OpenSSL library
 + md5: using OpenSSL library
 + sha1: using OpenSSL library
 + using system zlib library
nginx path prefix: "/usr/local/nginx-1.7.0"
 nginx binary file: "/usr/local/nginx-1.7.0/sbin/nginx"
 nginx configuration prefix: "/usr/local/nginx-1.7.0/conf"
 nginx configuration file: "/usr/local/nginx-1.7.0/conf/nginx.conf"
 nginx pid file: "/usr/local/nginx-1.7.0/logs/nginx.pid"
 nginx error log file: "/usr/local/nginx-1.7.0/logs/error.log"
 nginx http access log file: "/usr/local/nginx-1.7.0/logs/access.log"
 nginx http client request body temporary files: "client_body_temp"
 nginx http proxy temporary files: "proxy_temp"
 nginx http fastcgi temporary files: "fastcgi_temp"
 nginx http uwsgi temporary files: "uwsgi_temp"
 nginx http scgi temporary files: "scgi_temp"
# make //確定你的服務器有安裝make,如果沒有安裝請執行yum install make

# make install

三、啟動、關閉、重置nginx

啟動:直接執行以下命令,nginx就啟動了,不需要改任何配置文件,nginx配置多域名虛擬主機請參考后續文章.
代碼如下:/usr/local/nginx-1.7.0/sbin/nginx
試試訪問:直接使用curl命令來讀取web信息
代碼如下:
[root@ns conf]
# curl -s http://localhost | grep nginx.com
nginx.com.
關閉:
代碼如下:/usr/local/nginx-1.7.0/sbin/nginx -s stop
重置:當你有修改配置文件的時候,只需要reload以下即可
代碼如下:/usr/local/nginx-1.7.0/sbin/nginx -s reload
整個nginx的安裝就到這里結束了。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 海林市| 射洪县| 环江| 文登市| 东台市| 固阳县| 蓬安县| 介休市| 刚察县| 扎赉特旗| 伊金霍洛旗| 会理县| 额敏县| 嫩江县| 乌拉特后旗| 肃宁县| 吉水县| 海宁市| 揭西县| 富平县| 巩义市| 焉耆| 赤水市| 凉城县| 金山区| 泉州市| 突泉县| 土默特左旗| 信宜市| 乐至县| 颍上县| 苏尼特左旗| 哈尔滨市| 闸北区| 达尔| 黔东| 抚远县| 康平县| 涞源县| 公安县| 宜兰县|