nagios with php-fpm
/etc/httpd/conf
vi httpd.conf
IncludeOptional conf.d/*.conf
[root@sm56 conf.d]# cat nagios.conf
[root@sm56 conf.d]# cat nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
<FilesMatch "\.(inc|php|phtml|phps)$">
<IfVersion = /^2.4.6[012]$/>
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "%{unescape:%{SCRIPT_FILENAME}}"
</IfVersion>
AddHandler "proxy:unix:/usr/local/php83/sockets/nagios.sock|fcgi://localhost" .inc .php .phtml
</FilesMatch>
<FilesMatch "\.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<IfModule mod_fcgid.c>
SuexecUserGroup nagios nagios
</IfModule>
# SSLRequireSSL
Options ExecCGI
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</IfVersion>
</Directory>
Alias /nagios "/usr/local/nagios/share"
ErrorLog /var/log/httpd/domains/nagios.log
<Directory "/usr/local/nagios/share">
<FilesMatch "\.(inc|php|phtml|phps)$">
<IfVersion = /^2.4.6[012]$/>
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "%{unescape:%{SCRIPT_FILENAME}}"
</IfVersion>
#ProxyPassMatch ^/(nagios/.*\.php)$ unix:/usr/local/php83/sockets/nagios.sock|fcgi://localhost/usr/local/nagios/share/
AddHandler "proxy:unix:/usr/local/php83/sockets/nagios.sock|fcgi://localhost" .inc .php .phtml
</FilesMatch>
<FilesMatch "\.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<IfModule mod_fcgid.c>
SuexecUserGroup nagios nagios
</IfModule>
# SSLRequireSSL
Options None
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</IfVersion>
</Directory>
[root@sm56 conf.d]#
mkdir -p /usr/local/directadmin/data/users/nagios/
[root@sm56 conf.d]# cat /usr/local/directadmin/data/users/nagios/php/php-fpm83.conf
[nagios]
user = nagios
group = apache
listen = /usr/local/php83/sockets/nagios.sock
listen.owner = nagios
listen.group = apache
listen.mode = 660
pm = ondemand
pm.max_children = 10
pm.process_idle_timeout = 20
pm.max_requests = 500
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f nagios@sm56.dinpl.com
php_admin_value[session.save_path] = /home/nagios/tmp
php_admin_value[open_basedir] = /usr/local/nagios/share:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php83/lib/:/usr/local/lib/php/
php_admin_value[mail.log] = /home/nagios/.php/php-mail.log
security.limit_extensions = .php .php52 .php53 .php54 .php55 .php56 .php60 .php70 .php71 .phtml .inc .php83
[root@sm56 conf.d]#
Comments
Post a Comment