服务器群集——Nginx 优化(隐藏版本号-修改用户和组-设置缓存时间-日志分割-配置Nginx连接超时-网页压缩-防盗链-FPM参数优化)

一、隐藏版本号

1.1 隐藏版本号概述

影藏版本号,避免安全漏洞泄露
nginx隐藏版本号的方法

  • 修改配置文件法
  • 修改源码法

1.2 隐藏版本号实例

方法一 修改配置文件法

实验步骤:
1、手工编译Nginx
2、修改配置文件隐藏源码

[root@localhost nginx-1.12.2]# curl -I http://192.168.200.80  // 访问网站使用curl -I 命令检测,Curl -I 查看头部信息
HTTP/1.1 200 OK
Server: nginx/1.12.2                                        //可以看到版本号
Date: Mon, 10 Aug 2020 07:15:49 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 10 Aug 2020 07:09:11 GMT
Connection: keep-alive
ETag: "5f30f297-264"
Accept-Ranges: bytes
[root@localhost nginx-1.12.2]# cd /usr/local/nginx/conf/     
[root@localhost conf]# ls
fastcgi.conf            koi-utf             nginx.conf           uwsgi_params
fastcgi.conf.default    koi-win             nginx.conf.default   uwsgi_params.default
fastcgi_params          mime.types          scgi_params          win-utf
fastcgi_params.default  mime.types.default  scgi_params.default
[root@localhost conf]# vim nginx.conf          //修改配置文件参数
http {
    include       mime.types;
    default_type  application/octet-stream;
    server_tokens off;        //加这句话,关闭版本号
[root@localhost conf]# service nginx stop
[root@localhost conf]# service nginx start 
[root@localhost conf]# netstat -ntap | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      17476/nginx: master 
[root@localhost conf]# curl -I http://192.168.200.80      // 访问网站使用curl -I 命令检测,Curl -I 查看头部信息
HTTP/1.1 200 OK
Server: nginx                                          //版本号被隐藏
Date: Mon, 10 Aug 2020 07:20:05 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 10 Aug 2020 07:09:11 GMT
Connection: keep-alive
ETag: "5f30f297-264"
Accept-Ranges: bytes

使用PHP处理动态网页,修改配置文件法

  • 若PHP配置文件中配置了fastcgi_ param
    SERVER_ SOFTWARE选项
  • 则编辑php-fpm配置文件,将fastcgi param
    SERVER_ SOFTWARE对应的值修改为astcgi param
    SERVER_ _SOFTWARE nginx ;

在这里插入图片描述
在这里插入图片描述

方法二 修改源码法

1、Nginx源码文件/usr/src/nginx-1.12.0/src/core/nginx.h
包含版本信息,可以随意设置置
2、重新编译安装,隐藏版本信息
示例

  • #define NGINX_ _VERSION"1.1.1",修改版本号为1.1.1
  • #define NGINX_ _VER lIS/" , 修改软件类型为IIS
    3、重启服务,访问网站使用curl -|命令检测
[root@localhost ~]# iptables -F
[root@localhost ~]#  setenforce 0
[root@localhost ~]# cd /opt/
[root@localhost opt]# rz -E     //通过xshell拖入文件
rz waiting to receive.
[root@localhost opt]# ls
nginx-1.12.2.tar.gz  rh
[root@localhost opt]# tar zxvf nginx-1.12.2.tar.gz
[root@localhost opt]# yum -y install gcc gcc-c++ pcre pcre-devel zlib-devel    //安装编译环境
[root@localhost opt]# useradd -M -s /sbin/nologin nginx       //创建管理用户
[root@localhost opt]# cd nginx-1.12.2/
[root@localhost nginx-1.12.2]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
[root@localhost nginx-1.12.2]# cd src/
[root@localhost src]# ls
core  event  http  mail  misc  os  stream
[root@localhost src]# cd core/
[root@localhost core]# ls
nginx.c           ngx_cycle.h            ngx_output_chain.c    ngx_rwlock.c
nginx.h           ngx_file.c             ngx_palloc.c          ngx_rwlock.h
ngx_array.c       ngx_file.h             ngx_palloc.h          ngx_sha1.c
ngx_array.h       ngx_hash.c             ngx_parse.c           ngx_sha1.h
ngx_buf.c         ngx_hash.h             ngx_parse.h           ngx_shmtx.c
ngx_buf.h         ngx_inet.c             ngx_parse_time.c      ngx_shmtx.h
ngx_conf_file.c   ngx_inet.h             ngx_parse_time.h      ngx_slab.c
ngx_conf_file.h   ngx_list.c             ngx_proxy_protocol.c  ngx_slab.h
ngx_config.h      ngx_list.h             ngx_proxy_protocol.h  ngx_spinlock.c
ngx_connection.c  ngx_log.c              ngx_queue.c           ngx_string.c
ngx_connection.h  ngx_log.h              ngx_queue.h           ngx_string.h
ngx_core.h        ngx_md5.c              ngx_radix_tree.c      ngx_syslog.c
ngx_cpuinfo.c     ngx_md5.h              ngx_radix_tree.h      ngx_syslog.h
ngx_crc32.c       ngx_module.c           ngx_rbtree.c          ngx_thread_pool.c
ngx_crc32.h       ngx_module.h           ngx_rbtree.h          ngx_thread_pool.h
ngx_crc.h         ngx_murmurhash.c       ngx_regex.c           ngx_times.c
ngx_crypt.c       ngx_murmurhash.h       ngx_regex.h           ngx_times.h
ngx_crypt.h       ngx_open_file_cache.c  ngx_resolver.c
ngx_cycle.c       ngx_open_file_cache.h  ngx_resolver.h
[root@localhost core]# vim nginx.h
#define NGINX_VERSION      "1.1.1"    //将编译文件信息修改成1.1.1
[root@localhost core]# cd ../..
[root@localhost nginx-1.12.2]#  ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
[root@localhost nginx-1.12.2]# make
[root@localhost nginx-1.12.2]# make install
[root@localhost nginx-1.12.2]# ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/
[root@localhost nginx-1.12.2]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost nginx-1.12.2]# vim /etc/init.d/nginx    //给service管理
#!/bin/bash
# chkconfig: - 99 20
# description: Nginx Service Control Script
PROG="/usr/local/nginx/sbin/nginx"
PIDF="/usr/local/nginx/logs/nginx.pid"
case "$1" in
 start)
  $PROG
  ;;
 stop)
  kill -s QUIT $(cat $PIDF)
  ;;
 restart)
  $0 stop
  $0 start
  ;;
 reloard)
  kill -s HUP $(cat $PIDF)
  ;;
 *)
  echo "Usage:$0{start|stop|restart|reload}"
  exit 1
esac
exit 0
[root@localhost nginx-1.12.2]# chmod +x /etc/init.d/nginx 
[root@localhost nginx-1.12.2]# service nginx start 
[root@localhost nginx-1.12.2]# netstat -natp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      24806/nginx: master 
[root@localhost nginx-1.12.2]# curl -I 192.168.200.70
HTTP/1.1 200 OK
Server: nginx/1.1.1                                         //更改的版本信息
Date: Mon, 10 Aug 2020 07:37:33 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 10 Aug 2020 07:29:42 GMT
Connection: keep-alive
ETag: "5f30f766-264"
Accept-Ranges: bytes

二、修改Nginx用户和组

1、步骤

1、Nginx运行时进程需要有用户与组的支持,以实现对网站文件读取时进行访问控制
2、Nginx默认使用nobody用户账号与组账号
3、修改的方法;

  • 编译安装时指定用户与组
  • 修改配置文件指定用户与组

2、编译安装时指定

1、创建用户账号与组账号,如nginx
2、编译安装时-user与–group指定Nginx服务的运行用户与组账号
[root@www nginx-1.12.0]# ./configure \

  • prefix/usrlocal/nginx
    –user=nginx
    –group=nginx

3、实例

接方法一实验

[root@localhost conf]# id nobody
uid=99(nobody) gid=99(nobody) 组=99(nobody)
[root@localhost conf]# vim nginx.conf
user nginx nginx;   设置用户和组
[root@localhost conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost conf]# service nginx stop 
[root@localhost conf]# service nginx start 
[root@localhost conf]# ps aux | grep nginx
root      73267  0.0  0.0  20544   612 ?        Ss   15:51   0:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx     73268  0.0  0.0  23072  1384 ?        S    15:51   0:00 nginx: worker process
root      73283  0.0  0.0 112724   984 pts/1    S+   15:52   0:00 grep --color=auto nginx

三、配置Nginx网页缓存时间

1、概述

1、当Nginx将网页数据返回给客户端后,可设置缓存的时间,以方便在日后进行相同内容的请求时直接返回,避免重复请求,加快了访问速度
2、一般针对静态网页设置,对动态网页不设置缓存时间
配置Nginx网页缓存时间2-2

2、设置方法

●修改配置文件,在http段、 或者server段、 或者location段加入对特定内容的过期参数
■示例
●修改Nginx的配置文件,在location段加入expires 参数

location ~ \.(gifljpgljiepglpng|bmp lico)$ {
root html;
expires 1d;

3、实验

[root@localhost conf]# vim /usr/local/nginx/conf/nginx.conf
location ~\.(gif|jpg|jpeg|png|ico)$ {
            root   html;
            expires 1d;
        }
[root@localhost conf]# cd ..
[root@localhost nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@localhost nginx]# cd html/
[root@localhost html]# ls
50x.html  index.html
[root@localhost html]# rz -E          //xshell插入图片
rz waiting to receive.
[root@localhost html]# ls
50x.html  game.jpg  index.html
[root@localhost html]# vim index.html 
<img src="game.jpg"/>
[root@localhost conf]# service nginx start
[root@localhost conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
打开win10操作系统
登录192.168.200.80

四、实现Nginx的日志切割

1、概述

1、随着Nginx运行时间增加,日志也会增加。为了方便掌握Nginx运行状态,需要时刻关注Nginx日志文件
2、太大的日志文件对监控是-一个大灾难

  • 定期进行日志文件的切割
    3、Nginx自身不具备日志分割处理的功能,但可以通过Nginx信号控制功能的脚本实现日志的自动切割
    4、通过Linux的计划任务周期性地进行日志切割

2、编写脚本进行日志切割的思路

  • 设置时间变量
  • 设置保存日志路径
  • 将目前的日志文件进行重命名
  • 重建新日志文件
  • 删除时间过长的日志文件
  • 设置cron任务,定期执行脚本自动进行日志分割

3、Nginx的日志切割 实验

[root@localhost ~]# cd /opt/
[root@localhost opt]# vim fenge.sh
#!/bin/bash
#Filename:fenge.sh 
d=$(date -d "-1 day" "+%Y%m%d")               //设置日期名称
logs_path="/var/log/nginx"
pid_path="/usr/local/nginx/logs/nginx.pid"
[ -d $logs_path ] || mkdir -p $logs_path           //自动创建日志目录
mv /usr/local/nginx/logs/access.log ${logs_path}/test.com-access.log-$d   //分割日志
kill -HUP $(cat $pid_path)    //生成新日志
find $logs_path -mtime +30 | xargs rm -rf     //删除30天前的日志
[root@localhost opt]# chmod +x fenge.sh
[root@localhost opt]# cd /var/log/
[root@localhost log]# ls    //查看没有日志
anaconda  firewalld           ntpstats  speech-dispatcher     vmware-vgauthsvc.log.0
audit     gdm                 pluto     spooler               vmware-vmsvc.log
boot.log  glusterfs           ppp       sssd                  vmware-vmusr.log
btmp      grubby_prune_debug  qemu-ga   swtpm                 wpa_supplicant.log
chrony    lastlog             rhsm      tallylog              wtmp
cron      libvirt             sa        tuned                 Xorg.0.log
cups      maillog             samba     vmware-network.1.log  Xorg.9.log
dmesg     messages            secure    vmware-network.log    yum.log
[root@localhost log]# cd /opt/
[root@localhost opt]# ./fenge.sh     //执行脚本
[root@localhost opt]# ls /var/log/nginx/   //自动创建了日志文件
test.com-access.log-20200809
[root@localhost opt]# crontab -e   //创建计划性周期任务
0 1 * * * /opt/fenge.sh

五、配置Nginx连接超时

1、概述

1、为避免同一客户端长时间占用连接,造成资源浪费,可设置相应的连接超时参数,实现控制连接访问时间
2、超时参数

  • Keepalive_ timeout 设置连接保持超时时间
  • Client header_ _timeout 指定等待客户端发送请求头的超时时间
  • Client_ body_ _timeout 设置请求体读超时时间
    指定每个TCP连接最多可以保持多长时间。Nginx的默认值是65秒,有些浏览器最多只保持60秒,
    若将它设置为0,就禁止了keepalive连接。

2、实验

[root@localhost opt]# vim /usr/local/nginx/conf/nginx.conf
    keepalive_timeout  100;
    client_header_timeout 80;   //等待客户端发送请求的超时时间 超时会发送408错误
    client_body_timeout 80;      //设置客户端发送请求体超时时间
[root@localhost opt]# service nginx stop 
[root@localhost opt]# service nginx start 

六、更改nginx运行进程数

1、概述

1、在高并发场景,需要启动更多的Nginx进程以保证快速响应,以处理用户的请求,避免造成阻塞
2、更改进程数的配置方法

  • 修改配置文件,修改进程配置参数

2、步骤

1、修改配置文件的worker_ processes参数

  • 一般设为CPU的个数或者核数
  • 在高并发情况下可设置为CPU个数或者核数的2倍
    2、增加进程数,可减少了系统的开销,提升了服务速度
    3、使用ps aux查看运行进程数的变化情况
    [root@www con]# cat /proc/cpuinfo I grep -c “physical”
    4
    [root@www conf]# vi nginx.conf
    worker_ processes 4;
    [root@www conf]# systemctl restart nginx
    [root@www conf]# ps aux I grep nginx

3、实验

[root@localhost opt]# cat /proc/cpuinfo | grep -c "physical"    //查看物理核心数
8
root@localhost opt]# ps aux | grep nginx
root      75577  0.0  0.0  20544   612 ?        Ss   19:10   0:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx     75578  0.0  0.0  23072  1388 ?        S    19:10   0:00 nginx: worker process
root      75714  0.0  0.0 112724   988 pts/2    S+   19:25   0:00 grep --color=auto nginx
[root@localhost opt]# vim /usr/local/nginx/conf/nginx.conf
worker_processes  4;
[root@localhost opt]# service nginx stop 
[root@localhost opt]# service nginx start 
[root@localhost opt]# ps aux | grep nginx
root      75809  0.0  0.0  20544   616 ?        Ss   19:29   0:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx     75810  0.0  0.0  23072  1392 ?        S    19:29   0:00 nginx: worker process      //worker
nginx     75811  0.0  0.0  23072  1392 ?        S    19:29   0:00 nginx: worker process     //worker
nginx     75812  0.0  0.0  23072  1392 ?        S    19:29   0:00 nginx: worker process     //worker
nginx     75813  0.0  0.0  23072  1392 ?        S    19:29   0:00 nginx: worker process     //worker
root      75825  0.0  0.0 112724   984 pts/2    S+   19:29   0:00 grep --color=auto nginx

七、网页压缩

1、概述

vim /usr/local/nginx/conf/nginx.conf
gzip on;#开启gzip压缩功能
gzip_ min length 1k;#压缩阈值
gzip buffers 4 16k;#buffer大小为4个1 6k缓冲区大小
gzip
http. version 1.1; #压缩版本
gzip_ comp level 6;#压缩比率,最小为1,处理速度快,传输速度慢,9最大压缩比,处理速度慢,传输速度快
gzip_ disable “MSIE [1-6].”; #配置禁用gzip条件,支持正则,表示ie6以下不启用gzip
gzip. vary on; #选择支持very header可以让前端的缓存服务器缓存经过gzip压缩的页面

2、实验

[root@localhost opt]# vim /usr/local/nginx/conf/nginx.conf
    gzip  on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 6;
    gzip_types text/plain application/x-javascript text/css image/jpg image/jpeg image/png im
age/gif application/xml text/javascript application/x-httpd-php application/javascript applic
ation/json;
    gzip_disable "MSIE[1-6]\.";
    gzip_vary on;
[root@localhost opt]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost local]# ls
bin  etc  games  include  lib  lib64  libexec  nginx  sbin  share  src
[root@localhost local]# cd nginx/
[root@localhost nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@localhost nginx]# cd html/
[root@localhost html]# ls
50x.html  game.jpg  index.html
[root@localhost html]# service nginx stop 
[root@localhost html]# service nginx start 
进入win10打开浏览器,打开监控软件,输入192.168.200.80,打开监控软件,可以看到压缩开启

在这里插入图片描述

八、Nginx 配置网页防盗链

实验环境:192.168.200.70官网服务器,192.168.200.80盗链网站
1、配置192.168.200.70官网服务器

[root@localhost ~]# iptables -F 
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum -y install gcc gcc-c++ pcre pcre-devel zlib-devel 
[root@localhost ~]# useradd -M -s /sbin/nologin nginx
[root@localhost ~]# cd /opt/
[root@localhost opt]# ls
nginx-1.12.2.tar.gz  rh
[root@localhost opt]# tar zxvf nginx-1.12.2.tar.gz 
[root@localhost opt]# cd nginx-1.12.2/
[root@localhost nginx-1.12.2]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
[root@localhost nginx-1.12.2]# make && make install
[root@localhost nginx-1.12.2]# cd /etc/init.d/
[root@localhost init.d]# vim nginx
#!/bin/bash
# chkconfig: - 99 20
# description: Nginx Service Control Script
PROG="/usr/local/nginx/sbin/nginx"
PIDF="/usr/local/nginx/logs/nginx.pid"
case "$1" in
 start)
  $PROG
  ;;
 stop)
  kill -s QUIT $(cat $PIDF)
  ;;
 restart)
  $0 stop
  $0 start
  ;;
 reloard)
  kill -s HUP $(cat $PIDF)
  ;;
 *)
  echo "Usage:$0{start|stop|restart|reload}"
  exit 1
esac
exit 0

[root@localhost init.d]# chmod +x nginx 
[root@localhost init.d]# ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/
[root@localhost init.d]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost init.d]# service nginx start 
[root@localhost init.d]# netstat -antp | grep nginx 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      24849/nginx: master 
[root@localhost init.d]# cd /usr/local/nginx/
[root@localhost nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@localhost nginx]# cd html/
[root@localhost html]# ls
50x.html  index.html
拖入图片
[root@localhost html]# ls
50x.html  game.jpg  index.html
[root@localhost html]# vim index.html 
<img src="game.jpg"/>
[root@localhost html]# yum -y install bind
[root@localhost html]# vim /etc/named.conf 
options {
        listen-on port 53 { any; };
        allow-query     { any; };
[root@localhost html]# vim /etc/named.rfc1912.zones 
zone "kgc.com" IN {
        type master;
        file "kgc.com.zone";
        allow-update { none; };
};
[root@localhost html]# cd /var/named/
[root@localhost named]# ls
data  dynamic  named.ca  named.empty  named.localhost  named.loopback  slaves
[root@localhost named]# cp -p named.localhost kgc.com.zone
[root@localhost named]# vim kgc.com.zone 
www IN  A       192.168.200.70
[root@localhost named]# systemctl start named
打开win10计算机,然后把dns改成192.168.200.70,打开浏览器登录ip地址192.168.200.70,成功现实网页

2、制作192.168.200.80盗链网站

[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum -y install httpd
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
Listen 192.168.200.80:80
#Listen 80
ServerName www.test.com:80
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
[root@localhost html]# vim index.html
<h1>this is test web</h1>
<img src="http://www.kgc.com/game.jpg"/>
[root@localhost html]# echo "nameserver 192.168.200.70" > /etc/resolv.conf
[root@localhost html]# systemctl start httpd
用win10浏览访问192.168.200.80,能正常显示

3、在192.168.200.70服务器上操作

[root@promote ~]# cd /usr/local/nginx/
[root@promote nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@promote conf]# vim nginx.conf
   location ~*\.(jpg|gif|swf)$ {
            valid_referers none blocked *.kgc.com kgc.com;
            if ( $invalid_referer ) {
            rewrite ^/ http://www.kgc.com/error.png;
            }
        }
[root@promote conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@promote conf]# cd ..
[root@promote nginx]# cd html/
[root@promote html]# rz -E
rz waiting to receive.
[root@promote html]# ls
50x.html  error.png  game.jpg  index.html
[root@promote html]# service nginx restart 
WIN10浏览器访问192.168.200.80,出现的是error的图片

九、FPM参数优化

1、概述

Nginx 的PHP解析功能实现是交由FPM处理的,为了提高PHP的处理速度,可对FPM模块进行参数的调整。

2、步骤

  • 首先安装带FPM模块的PHP环境,保证PHP可以正常运行。
  • FPM进程有两种启动方式,由pm参数指定,分别是static和dynamic,前者将产生固定数据的FPM进程,后者将以动态的方式产生FPM进程。
    static 方式可以使用pm.max_children 指定启动的进程数量。dynamic方式的参数则要根据服务器的内存与服务负载进行调整。
fpm参数优化
vi php-fpm.conf
pid = run/php-fpm.pid
pm = dynamic
pm.max children= 20#static模式下空闲进程数上限,大于下面的值
pm.start servers= 5 #动态方式下默认开启的进程数,在最小和最大之间
pm.min_ spare_ servers = 2 #动态方式下最少空闲进程数
pm.max_ spare_ servers = 8 #动态方式下最大空闲进程数

3、实验

1、手工编译安装lnmp
2、fpm优化

[root@localhost conf]# cd /usr/local/php/etc
[root@localhost etc]# ls
pear.conf  php-fpm.conf  php-fpm.conf.default  php-fpm.d
[root@localhost etc]# vim php-fpm.conf
pid = run/php-fpm.pid
pm = dynamic
pm.max_children=20
pm.start.servers=5
pm.min_ spare_ servers = 2
pm.max_ spare_ servers = 8
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值