zoukankan      html  css  js  c++  java
  • nginx添加模块记录

    查看现有nginx的编译参数:

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# nginx -V
    nginx version: nginx/1.12.2
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
    built with OpenSSL 1.0.2l 25 May 2017
    TLS SNI support enabled
    configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/root/lnmp1.4/src/openssl-1.0.2l --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

    查看所需模块名字:

    原有nginx编译目录:

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# cd /nginx-1.12.2    

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# ./configure --help | grep proxy
    --without-http_proxy_module   disable ngx_http_proxy_module

    重新编译模块参数:

    ./configure --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 --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-openssl=/root/lnmp1.4/src/openssl-1.0.2l

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# make

    替换nginx二进制文件:

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# which nginx
    /usr/bin/nginx

    可以看到是一个软连接:
    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# ll /usr/bin/nginx
    lrwxrwxrwx 1 root root 27 May 7 2018 /usr/bin/nginx -> /usr/local/nginx/sbin/nginx

    停止nginx:  

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# nginx -s stop

    [root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# cp objs/nginx /usr/local/nginx/sbin/nginx

    启动nginx:

  • 相关阅读:
    Python全栈开发记录_第七篇(模块_time_datetime_random_os_sys_hashlib_logging_configparser_re)
    Python全栈开发记录_第六篇(生成器和迭代器)
    Python全栈开发记录_第五篇(装饰器)
    Python全栈开发记录_第四篇(集合、函数等知识点)
    Python全栈开发记录_第三篇(linux(ubuntu)的操作)
    Python全栈开发记录_第二篇(文件操作及三级菜单栏增删改查)
    Python全栈开发记录_第一篇(循环练习及杂碎的知识点)
    NET控件Designer架构设计
    如何把Excel中的单元格等对象保存成图片
    “某某云词典” – 纠结的初体验
  • 原文地址:https://www.cnblogs.com/byfboke/p/11127892.html
Copyright © 2011-2022 走看看