fpm 885 B

1234567891011121314151617
  1. # Create fpm group and user
  2. ! grep -q "^$fpm_group:" /etc/group && \
  3. $userdo groupadd --system $fpm_group
  4. ! grep -q "^$fpm_user:" /etc/passwd && \
  5. $userdo useradd --system -m -d /var/www -s /usr/sbin/nologin -g $fpm_group $fpm_user && \
  6. find /var/www -maxdepth 0 -empty && \
  7. # Change owner and perm only if /var/www is empty
  8. $userdo chown root:root -c /var/www/ && \
  9. $userdo chmod -c 755 /var/www/
  10. # Copy fpm configuration files
  11. $userdo cp -pv $sysconfdir/php-fpm.conf.default $sysconfdir/php-fpm.conf
  12. $userdo cp -pv $sysconfdir/php-fpm.d/www.conf.default $sysconfdir/php-fpm.d/www.conf
  13. [[ $fpm_listen != '' ]] && \
  14. $userdo sed -r -i "s/^listen = .*/listen = $fpm_listen/" $sysconfdir/php-fpm.d/www.conf
  15. [[ "$fpm_allowed_clients" != '' ]] && \
  16. $userdo sed -r -i "s/^;?listen.allowed_clients = .*/listen.allowed_clients = $fpm_allowed_clients/" $sysconfdir/php-fpm.d/www.conf