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

    nginx模块添加

    下载需要添加的模块

    git clone
    https://github.com/cuber/ngx_http_google_filter_module
    
    [root@web-nginx ~]# nginx -V
    nginx version: nginx/1.20.1
    built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
    built with OpenSSL 1.0.2k-fips  26 Jan 2017
    TLS SNI support enabled
    configure arguments: --user=nginx --group=nginx --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --error-log-path=/var/log/nginx/nginx_error.log --http-log-path=/var/log/nginx/nginx_access.log --pid-path=/usr/local/nginx/run/nginx.pid --lock-path=/usr/local/nginx/lock/nginx --with-http_image_filter_module --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_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-pcre --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi
    
    

    添加模块重新编译配置

    [root@web-nginx ~]# cd /usr/local/src/nginx-1.20.1
    [root@web-nginx nginx-1.20.1]# ./configure 
    --user=nginx 
    --group=nginx 
    --prefix=/usr/local/nginx 
    --conf-path=/etc/nginx/nginx.conf 
    --sbin-path=/usr/sbin/nginx 
    --error-log-path=/var/log/nginx/nginx_error.log 
    --http-log-path=/var/log/nginx/nginx_access.log 
    --pid-path=/usr/local/nginx/run/nginx.pid 
    --lock-path=/usr/local/nginx/lock/nginx 
    --with-http_image_filter_module 
    --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_gzip_static_module 
    --with-http_stub_status_module 
    --with-http_perl_module 
    --with-mail 
    --with-mail_ssl_module 
    --with-pcre 
    --http-client-body-temp-path=/var/tmp/nginx/client/ 
    --http-proxy-temp-path=/var/tmp/nginx/proxy 
    --http-fastcgi-temp-path=/var/tmp/nginx/fcgi 
    --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi 
    --http-scgi-temp-path=/var/tmp/nginx/scgi 
    –-add-module=/data/software/ngx_http_google_filter_module
    
    [root@web-nginx nginx-1.20.1]# make		//不需要make install
    
    [root@web-nginx nginx-1.20.1]# cp /usr/sbin/nginx	/usr/sbin/nginx.bak
    [root@web-nginx nginx-1.20.1]# 
    [root@web-nginx nginx-1.20.1]# cp /usr/local/src/nginx-1.20.1/objs/nginx /usr/sbin/nginx
    [root@web-nginx ~]# systemctl reload nginx
    [root@web-nginx ~]# ss -tunlp |grep nginx
    [root@web-nginx ~]# nginx -V
    
    配置若有遗漏或错误,请评论留言。
  • 相关阅读:
    lsmod-查看内核模块信息
    centos 7 下通过 conda 安装 cuda pytorch
    python 中文编码
    matplotlib
    How to determine the correct number of epoch during neural network training? 如何确定Epoch
    nvidia-smi Failed to initialize NVML: Driver/library version mismatch
    MySQL MAX函数:查询指定列的最大值
    mysql之group_concat函数详解
    @Param注解的用法解析@Param注解的用法解析
    【MySQL函数】replace()函数
  • 原文地址:https://www.cnblogs.com/BrokenEaves/p/15155477.html
Copyright © 2011-2022 走看看