Server security

php.ini

PHP settings are defined in:

Locate .ini files

Console environment

$ php --ini
Configuration File (php.ini) Path: /etc/php
Loaded Configuration File:         /etc/php/php.ini
Scan for additional .ini files in: /etc/php/conf.d
Additional .ini files parsed:      /etc/php/conf.d/xdebug.ini

Server environment

fail2ban

fail2ban is an intrusion prevention framework that reads server (Apache, SSH, etc.) and uses iptables profiles to block brute-force attempts:

Read Shaarli logs to ban IPs

Example configuration:

/etc/fail2ban/jail.local

[shaarli-auth][](.html)
enabled  = true
port     = https,http
filter   = shaarli-auth
logpath  = /var/www/path/to/shaarli/data/log.txt
maxretry = 3
bantime = -1

/etc/fail2ban/filter.d/shaarli-auth.conf

[INCLUDES][](.html)
before = common.conf
[Definition][](.html)
failregex = \s-\s<HOST>\s-\sLogin failed for user.*$
ignoreregex =