日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nginx安装(正式)

發布時間:2025/6/17 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx安装(正式) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、安裝說明

系統環境:CentOS Linux release 7.2.1511 (Core)
系統內核:3.10.0-327.el7.x86_64
軟件:nginx-1.10.1.tar.gz
其他所需軟件:pcre-devel 、openssl-devel 、GeoIP-devel 、zlib-devel
安裝方式:源碼編譯安裝
安裝位置:/usr/local/nginx

二、安裝前提

安裝nginx之前,確保系統安裝了g++、gcc

1.安裝pcre-devel

rewrite模塊需要 pcre 庫

$ sudo yum install pcre-devel -y

2.安裝openssl-devel

ssl 功能需要openssl庫

$ sudo yum install openssl-devel -y

3.安裝zlib-devel

gzip模塊需要 zlib 庫

$ sudo yum install zlib-devel -y

4.安裝GeoIP-devel

$ sudo yum install GeoIP-devel -y

三、安裝nginx

1.創建用戶

# useradd -M -s /sbin/nologin www

2.解壓

# tar zxf nginx-1.10.1.tar.gz -C /usr/local/

3.進入源碼包目錄

# cd /usr/local/nginx-1.10.1/

4.配置

./configure \ --user=www \ --group=www \ --prefix=/usr/local/nginx \ --sbin-path=/usr/sbin/nginx \ --http-log-path=/var/log/nginx/access.log \ --error-log-path=/var/log/nginx/error.log \ --http-client-body-temp-path=/var/cache/nginx/client_temp \ --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ --lock-path=/var/lock/nginx.lock \ --pid-path=/var/run/nginx.pid \ --with-debug \ --with-threads \ --with-http_ssl_module \ --with-http_geoip_module \ --with-http_gzip_static_module \ --with-http_gunzip_module \ --with-http_realip_module \ --with-http_secure_link_module \ --with-http_sub_module \ --with-http_stub_status_module \ --with-ipv6

5.編譯安裝

# make && make install

6.創建目錄

# mkdir -pv /var/cache/nginx/client_temp

7.驗證

# nginx -V

8.啟動、重載

啟動

# /usr/sbin/nginx

重載

# /usr/sbin/nginx -s reload

9.停止

查詢nginx主進程號

# ps aux|grep nginx

停止進程

# kill -QUIT 主進程號

快速停止

# kill -TERM 主進程號

強制停止

# pkill -9 nginx

10.測試

測試端口

# netstat -lnupt|grep 80

四、配置說明

1.安裝位置

/usr/local/nginx

2.配置文件位置

/usr/local/nginx/conf

3.二進制執行文件

/usr/sbin/nginx

configure執行結果

?

Configuration summary+ using threads+ using system PCRE library+ using system OpenSSL library+ md5: using OpenSSL library+ sha1: using OpenSSL library+ using system zlib librarynginx path prefix: "/usr/local/nginx"nginx binary file: "/usr/sbin/nginx"nginx modules path: "/usr/local/nginx/modules"nginx configuration prefix: "/usr/local/nginx/conf"nginx configuration file: "/usr/local/nginx/conf/nginx.conf"nginx pid file: "/var/run/nginx.pid"nginx error log file: "/var/log/nginx/error.log"nginx http access log file: "/var/log/nginx/access.log"nginx http client request body temporary files: "/var/cache/nginx/client_temp"nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"

?

來自為知筆記(Wiz)



轉載于:https://www.cnblogs.com/pangguoping/p/5729173.html

總結

以上是生活随笔為你收集整理的nginx安装(正式)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。