buhong 发表于 2018-8-1 13:16:27

Puppet函数介绍(十八)

# puppet agent -t  
Info: Retrieving pluginfacts
  
Info: Retrieving plugin
  
Info: Loading facts
  
Info: Caching catalog for sh-proxy2.localdomain
  
Info: Applying configuration version '1506534804'
  
Notice: /Stage/Admin/Exec/returns: executed successfully
  
Notice: /Stage/Php::Phpfpmconf/Php::Phpfpmconf::Generatephpfpmfiles/File/content:
  
--- /etc/php-fpm.d/www.conf2017-03-22 20:29:28.000000000 +0800
  
+++ /tmp/puppet-file20170928-96466-ix9fq8-02017-09-28 01:53:24.115952791 +0800
  
@@ -1,3 +1,13 @@
  
+
  
+; Pid file
  
+; Default Value: none
  
+pid = /var/run/php-fpm_www.pid
  
+
  
+
  
+; Error log file
  
+; Default Value: /usr/local/var/log/php-fpm.log
  
+error_log = /var/log/php-fpm/php-fpm.error.log
  
+
  
; Start a new pool named 'www'.
  

  

  
@@ -9,11 +19,14 @@
  
;                            specific port;
  
;   '/path/to/unix/socket' - to listen on a unix socket.
  
; Note: This value is mandatory.
  
-listen = 127.0.0.1:9000
  
+
  
+
  
+listen = 9000
  
+
  

  
; Set listen(2) backlog. A value of '-1' means unlimited.
  
; Default Value: -1
  
-;listen.backlog = -1
  
+listen.backlog = 4096
  

  
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  
@@ -21,7 +34,7 @@
  
; must be separated by a comma. If this value is left blank, connections will be
  
; accepted from any ip address.
  
; Default Value: any
  
-listen.allowed_clients = 127.0.0.1
  
+;listen.allowed_clients =
  

  
; Set permissions for unix socket, if one is used. In Linux, read/write
  
; permissions must be set in order to allow connections from a web server. Many
  
@@ -36,9 +49,9 @@
  
; Note: The user is mandatory. If the group is not set, the default user's group
  
;       will be used.
  
; RPM: apache Choosed to be able to access some dir as httpd
  
-user = apache
  
+user = nobody
  
; RPM: Keep a group allowed to write in log dir.
  
-group = apache
  
+group = www
  

  
; Choose how the process manager will control the number of child processes.
  
; Possible Values:
  
@@ -57,7 +70,7 @@
  
;                                    of 'idle' processes is greater than this
  
;                                    number then some children will be killed.
  
; Note: This value is mandatory.
  
-pm = dynamic
  
+pm = static
  

  
; The number of child processes to be created when pm is set to 'static' and the
  
; maximum number of child processes to be created when pm is set to 'dynamic'.
  
@@ -67,12 +80,12 @@
  
; CGI.
  
; Note: Used when pm is set to either 'static' or 'dynamic'
  
; Note: This value is mandatory.
  
-pm.max_children = 50
  
+pm.max_children = 20
  

  
; The number of child processes created on startup.
  
; Note: Used only when pm is set to 'dynamic'
  
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  
-pm.start_servers = 5
  
+pm.start_servers = 12
  

  
; The desired minimum number of idle server processes.
  
; Note: Used only when pm is set to 'dynamic'
  
@@ -82,13 +95,13 @@
  
; The desired maximum number of idle server processes.
  
; Note: Used only when pm is set to 'dynamic'
  
; Note: Mandatory when pm is set to 'dynamic'
  
-pm.max_spare_servers = 35
  
+pm.max_spare_servers = 20
  

  
; The number of requests each child process should execute before respawning.
  
; This can be useful to work around memory leaks in 3rd party libraries. For
  
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  
-; Default Value: 0
  
-;pm.max_requests = 500
  
+; Default Value: -2
  
+pm.max_requests = 5000
  

  
; The URI to view the FPM status page. If this value is not set, no URI will be
  
; recognized as a status page. By default, the status page shows the following
  
@@ -118,7 +131,7 @@
  
;       anything, but it may not be a good idea to use the .php extension or it
  
;       may conflict with a real PHP file.
  
; Default Value: not set
  
-;pm.status_path = /status
  
+pm.status_path = /status
  

  
; The ping URI to call the monitoring page of FPM. If this value is not set, no
  
; URI will be recognized as a ping page. This could be used to test from outside
  
@@ -135,20 +148,20 @@
  
; This directive may be used to customize the response of a ping request. The
  
; response is formatted as text/plain with a 200 response code.
  
; Default Value: pong
  
-;ping.response = pong
  
+ping.response = pong
  

  
; The timeout for serving a single request after which the worker process will
  
; be killed. This option should be used when the 'max_execution_time' ini option
  
; does not stop script execution for some reason. A value of '0' means 'off'.
  
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  
; Default Value: 0
  
-;request_terminate_timeout = 0
  
+request_terminate_timeout = 0
  

  
; The timeout for serving a single request after which a PHP backtrace will be
  
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  
; Default Value: 0
  
-;request_slowlog_timeout = 0
  
+request_slowlog_timeout = 10
  

  
; The log file for slow requests
  
; Default Value: not set
  
@@ -179,24 +192,16 @@
  
; Redirect worker stdout and stderr into main error log. If not set, stdout and
  
; stderr will be redirected to /dev/null according to FastCGI specs.
  
; Default Value: no
  
-;catch_workers_output = yes
  
+catch_workers_output = yes
  

  
-; Limits the extensions of the main script FPM will allow to parse. This can
  
-; prevent configuration mistakes on the web server side. You should only limit
  
-; FPM to .php extensions to prevent malicious users to use other extensions to
  
-; exectute php code.
  
-; Note: set an empty value to allow all extensions.
  
-; Default Value: .php
  
-;security.limit_extensions = .php .php3 .php4 .php5
  
-
  
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  
; the current environment.
  
; Default Value: clean env
  
-;env = $HOSTNAME
  
-;env = /usr/local/bin:/usr/bin:/bin
  
-;env = /tmp
  
-;env = /tmp
  
-;env = /tmp
  
+env = $HOSTNAME
  
+env = /usr/local/bin:/usr/bin:/bin
  
+env = /tmp
  
+env = /tmp
  
+env = /tmp
  

  
; Additional php.ini defines, specific to this pool of workers. These settings
  
; overwrite the values previously defined in the php.ini. The directives are the
  
@@ -215,12 +220,10 @@
  
; Default Value: nothing is defined by default except the values in php.ini and
  
;                specified at startup with the -d argument
  
;php_admin_value = /usr/sbin/sendmail -t -i -f www@my.domain.com
  
-;php_flag = off
  
-php_admin_value = /var/log/php-fpm/www-error.log
  
+php_flag = on
  
+php_admin_value = /var/log/php-fpm/www.error.log
  
php_admin_flag = on
  
-;php_admin_value = 128M
  
-
  
-; Set session path to a directory owned by process user
  
-php_value = files
  
-php_value = /var/lib/php/session
  
+;php_admin_value = 32M
  

  
+;add by zkf . add some file support. p file is used by channel.
  
+security.limit_extensions = .php .php3 .php4 .php5 .html .do .js .css .htm p
  
\ No newline at end of file
  
Info: Computing checksum on file /etc/php-fpm.d/www.conf
  
Info: /Stage/Php::Phpfpmconf/Php::Phpfpmconf::Generatephpfpmfiles/File: Filebucketed /etc/php-fpm.d/www.conf to puppet with sum 2402465907d7a7544db6315c55248938
  
Notice: /Stage/Php::Phpfpmconf/Php::Phpfpmconf::Generatephpfpmfiles/File/content: content changed '{md5}2402465907d7a7544db6315c55248938' to '{md5}a8ef2b23bd9feab1848d3dfe27ab1bd6'
  
Notice: Finished catalog run in 0.56 seconds
  
grep过滤修改的参数查看是否改变了:
  
# cat www.conf | grep requests
  
; The address on which to accept FastCGI requests.
  
; This value sets the limit on the number of simultaneous requests that will be
  
; The number of requests each child process should execute before respawning.
  
pm.max_requests = 5000
  
; The log file for slow requests
页: [1]
查看完整版本: Puppet函数介绍(十八)