最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CentOS 7下編譯安裝Nginx 1.11.10教程

 更新時間:2017年03月15日 09:38:21   作者:不爭  
這篇文章主要介紹了在CentOS 7下編譯安裝Nginx 1.11.10的方法,文中給出了詳細的安裝步驟,相信對大家具有一定的參考價值,需要的朋友們下面來一起看看吧。

前言

之前分享過一篇 CentOS下編譯安裝nginx及配置縮略圖插件的方法教程,當時的環(huán)境是 CentOS 6.x 和 Nginx 1.9.x 。 本次安裝的環(huán)境為 CentOS 7.2 和 Nginx 1.11.10, 有些配置以前自啟動的方式發(fā)生了變化, 這里再記錄一下。

安裝編譯安裝依賴的類庫和包

yum install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre-devel

下載和解壓 Nginx 1.11.10

wget http://nginx.org/download/nginx-1.11.10.tar.gz
tar -xzvf nginx-1.11.10.tar.gz
cd nginx-1.11.10

配置 Nginx 安裝選項

這里編譯了插件 http_image_filter_module, 來實現(xiàn)圖片的處理,采用默認的安裝路徑進行安裝。

./configure\
 --with-http_ssl_module\
 --with-http_v2_module\
 --with-http_realip_module\
 --with-http_addition_module\
 --with-http_xslt_module\
 --with-http_image_filter_module\
 --with-http_sub_module\
 --with-http_auth_request_module\
 --with-http_stub_status_module\
 --with-http_gzip_static_module

運行結(jié)果如下

[root@xx nginx-1.11.10]# ./configure\
> --with-http_ssl_module\
> --with-http_v2_module\
> --with-http_realip_module\
> --with-http_addition_module\
> --with-http_xslt_module\
> --with-http_image_filter_module\
> --with-http_sub_module\
> --with-http_auth_request_module\
> --with-http_stub_status_module\
> --with-http_gzip_static_module
checking for OS
 + Linux 3.10.0-327.22.2.el7.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... not found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for OpenSSL library ... found
checking for zlib library ... found
checking for libxslt ... found
checking for libexslt ... found
checking for GD library ... found
checking for GD WebP support ... not found
creating objs/Makefile
Configuration summary
 + using system PCRE library
 + using system OpenSSL library
 + using system zlib library
 nginx path prefix: "/usr/local/nginx"
 nginx binary file: "/usr/local/nginx/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: "/usr/local/nginx/logs/nginx.pid"
 nginx error log file: "/usr/local/nginx/logs/error.log"
 nginx http access log file: "/usr/local/nginx/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"

最后的幾行是配置的結(jié)果, 注意這里的 pid file 那一行,后面配置服務(wù)的時候,需要用的到。

安裝 Nginx

使用如下命令來安裝 nginx 。

make && make install

配置 systemd Nginx 服務(wù)和設(shè)置 Nginx 自啟動

centos 7 中采用 systemd 來管理系統(tǒng),我們來為 nginx 創(chuàng)建服務(wù)文件,來實現(xiàn)通過 systemd 來管理 nginx 。

創(chuàng)建 systemd 服務(wù)文件: /lib/systemd/system/nginx.service,內(nèi)容如下:

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target

這里的 PIDFile 的配置要和前面的 配置保持一致。

設(shè)置自啟動

systemctl enable nginx

通過 systemd 管理 nginx

systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl reload nginx

總結(jié)

好了,打完收工。以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。

相關(guān)文章

  • Nginx反向代理proxy_cache_path directive is not allowed錯誤解決方法

    Nginx反向代理proxy_cache_path directive is not allowed錯誤解決方法

    這篇文章主要介紹了Nginx反向代理proxy_cache_path directive is not allowed錯誤解決方法,需要的朋友可以參考下
    2015-04-04
  • Nginx Rewrite使用場景及代碼案例詳解

    Nginx Rewrite使用場景及代碼案例詳解

    這篇文章主要介紹了Nginx Rewrite使用場景及代碼案例詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
    2020-08-08
  • Nginx反向代理出現(xiàn)靜態(tài)文件404異常處理

    Nginx反向代理出現(xiàn)靜態(tài)文件404異常處理

    本文主要介紹了Nginx反向代理出現(xiàn)靜態(tài)文件404異常處理,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2025-05-05
  • Nginx的流式響應(yīng)配置實現(xiàn)小結(jié)

    Nginx的流式響應(yīng)配置實現(xiàn)小結(jié)

    nginx是一款自由的、開源的、高性能的HTTP服務(wù)器和反向代理服務(wù)器,本文主要介紹了Nginx的流式響應(yīng)配置實現(xiàn)小結(jié),具有一定的參考價值,感興趣的可以了解一下
    2024-04-04
  • Nginx中l(wèi)ocation實現(xiàn)多條件匹配的方法詳解

    Nginx中l(wèi)ocation實現(xiàn)多條件匹配的方法詳解

    在 Nginx 中,location 指令用于匹配請求的 URI,雖然 location 本身是基于單一匹配規(guī)則的,但可以通過多種方式實現(xiàn)多個條件的匹配邏輯,下面小編就來為大家介紹一下具體實現(xiàn)方法吧
    2025-03-03
  • Nginx實現(xiàn)ChatGPT?API代理步驟

    Nginx實現(xiàn)ChatGPT?API代理步驟

    這篇文章主要為大家介紹了Nginx實現(xiàn)ChatGPT?API代理步驟詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-05-05
  • Nginx 反向代理與負載均衡運行小結(jié)

    Nginx 反向代理與負載均衡運行小結(jié)

    Nginx還支持對后端服務(wù)器進行健康檢查,當某個服務(wù)器不可用時,Nginx會自動將流量重定向到其他可用的服務(wù)器,這篇文章給大家分享Nginx 反向代理與負載均衡是如何運行的,感興趣的朋友一起看看吧
    2024-03-03
  • nginx中指令root與alias舉例說明

    nginx中指令root與alias舉例說明

    在Nginx配置中,root和alias都是用于指定請求對應(yīng)的文件系統(tǒng)路徑的指令,但它們的工作方式有顯著區(qū)別,這篇文章主要介紹了nginx中指令root與alias的相關(guān)資料,文中通過代碼介紹的非常詳細,需要的朋友可以參考下
    2025-11-11
  • Nginx location匹配模式與規(guī)則詳解

    Nginx location匹配模式與規(guī)則詳解

    這篇文章主要介紹了Nginx location匹配模式與規(guī)則,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2025-04-04
  • Nginx+Tomcat負載均衡集群詳解

    Nginx+Tomcat負載均衡集群詳解

    這篇文章主要介紹了Nginx+Tomcat負載均衡集群,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2025-06-06

最新評論

西青区| 泰宁县| 株洲市| 会同县| 宝鸡市| 平湖市| 黄梅县| 盐山县| 商河县| 苗栗县| 河北省| 民权县| 汪清县| 郓城县| 周至县| 临猗县| 东海县| 富川| 丰顺县| 杭锦后旗| 汉源县| 方城县| 潮州市| 自治县| 湛江市| 乌鲁木齐市| 丹寨县| 九龙坡区| 定南县| 乌拉特后旗| 平顺县| 白朗县| 肥乡县| 西林县| 上栗县| 修水县| 油尖旺区| 永平县| 桓台县| 嘉黎县| 香港|