Files
ansible-lemp-wordpress/templates/www.conf.j2
Sebastian Palencsar dffd8e3b76 feat: v2.5.0 - Complete Technology & Security Update
Features:
- PHP 8.4 support (from 8.3)
- WordPress 7.0 (auto-update via WP-CLI)
- Modern TLS 1.3 cipher suites (2026 best practices)
- Fail2Ban security integration (5 jails: SSH, Nginx, WordPress, recidive)
- Auto-update cron job for WordPress (weekly Minor updates)
- Debian 14 Forky support (testing)
- Ubuntu 25.04 support
- Python 3.12 in GitHub Actions

Security:
- Fail2Ban with SSH brute force protection (24h ban)
- WordPress wp-login.php protection (2h ban)
- Nginx bot scanner protection
- Recidive jail for repeat offenders (1 week ban)
- Modern TLS ciphers (AEAD only)
- HSTS 2 years for preload

Documentation:
- docs/autoupdate.md - WordPress auto-update guide
- docs/fail2ban.md - Fail2Ban configuration guide
- docs/troubleshooting.md - Updated with php_version variable

Breaking changes:
- PHP 8.4 is now the default (requires Ubuntu 20.04+ or Debian 11+)
2026-05-04 19:37:27 +02:00

71 lines
2.4 KiB
Django/Jinja
Executable File

; PHP-FPM pool configuration for WordPress
; Generated by Ansible
[www]
user = {{ nginx_user }}
group = {{ nginx_user }}
; The address on which to accept FastCGI requests.
listen = {{ php_fpm_socket }}
; Set listen(2) backlog.
listen.backlog = 511
; Set permissions for unix socket, if one is used.
listen.owner = {{ nginx_user }}
listen.group = {{ nginx_user }}
listen.mode = 0660
; Pool management
pm = dynamic
pm.max_children = {{ php_fpm_max_children | default('20') }}
pm.start_servers = {{ php_fpm_start_servers | default('2') }}
pm.min_spare_servers = {{ php_fpm_min_spare_servers | default('1') }}
pm.max_spare_servers = {{ php_fpm_max_spare_servers | default('3') }}
pm.process_idle_timeout = 10s
pm.max_requests = {{ php_fpm_max_requests | default('1000') }}
; Status page
pm.status_path = /fpm-status
ping.path = /fpm-ping
ping.response = pong
; Logging
access.log = /var/log/php{{ php_version }}-fpm/$pool.access.log
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; Security
security.limit_extensions = .php .php3 .php4 .php5 .php7 .php8
; Environment variables
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
; PHP ini settings for WordPress
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@{{ domain_name | default('localhost') }}
php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php{{ php_version }}-fpm/www.error.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = {{ php_memory_limit | default('256M') }}
php_admin_value[upload_max_filesize] = {{ php_upload_max_filesize | default('64M') }}
php_admin_value[post_max_size] = {{ php_post_max_size | default('64M') }}
php_admin_value[max_execution_time] = {{ php_max_execution_time | default('300') }}
php_admin_value[max_input_time] = {{ php_max_input_time | default('300') }}
php_admin_value[max_input_vars] = {{ php_max_input_vars | default('3000') }}
; Session settings
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/sessions
php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
; OPcache settings
php_admin_value[opcache.enable] = 1
php_admin_value[opcache.memory_consumption] = 128
php_admin_value[opcache.interned_strings_buffer] = 16
php_admin_value[opcache.max_accelerated_files] = 10000
php_admin_value[opcache.revalidate_freq] = 2
php_admin_value[opcache.save_comments] = 1