欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

Nginx 编译,添加未编译安装模块ngx_cache_purge

程序员文章站 2022-04-20 19:09:22
...
Nginx 编译,添加未编译安装模块ngx_cache_purge

  1. 官网下载nginx及第三方ngx_cache_purge 模块
    http://wiki.nginx.org/Install
    http://labs.frickle.com/nginx_ngx_cache_purge/
  2. 编译与安装
Blockquote
./configure \
–prefix=/usr/local/nginx-1.8.0 \
–sbin-path=/usr/sbin/nginx \
–conf-path=/etc/nginx/nginx.conf \
–error-log-path=/var/log/nginx/error.log \
–http-log-path=/var/log/nginx/access.log \
–pid-path=/var/run/nginx/nginx.pid \
–lock-path=/var/lock/nginx.lock \
–user=nginx \
–group=nginx \
–with-http_ssl_module \
–with-http_flv_module \
–with-http_stub_status_module \
–with-http_gzip_static_module \
–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/ \
–add-module=/apps/svr/ngx_cache_purge-2.3
make && make install

3.为init.d 提供脚本

#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig:   - 85 15 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \ #               proxy and IMAP/POP3 proxy server # processname: nginx # config:      /etc/nginx/nginx.conf # config:      /etc/sysconfig/nginx # pidfile:     /var/run/nginx.pid # Source function library. 
. /etc/rc.d/init.d/functions 
# Source networking configuration. 
. /etc/sysconfig/network 
# Check that networking is up. 
[ "$NETWORKING" = "no" ] && exit0nginx="/usr/sbin/nginx"prog=$(basename $nginx) 
NGINX_C>"/etc/nginx/nginx.conf"