Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Secure phpMyAdmin with Fail2ban on Ubuntu—install Apache and phpMyAdmin with
apt update && apt install apache2 phpmyadmin
selecting Apache during setup (password: PhpMyAdm!n) Install Fail2ban via
apt install fail2ban
then create /etc/fail2ban/jail d/apache-phpmyadmin conf with
nano /etc/fail2ban/jail.d/apache-phpmyadmin.conf
:
[apache-phpmyadmin]\nenabled = true\nport = 80,443\nfilter = apache-auth\nlogpath = /var/log/apache2/error.log\nmaxretry = 5\nbantime = 3600
Restart with
systemctl restart fail2ban
open ports with
ufw allow 80 && ufw allow 443
On Hetzner access https://ip/phpmyadmin—Fail2ban ensures uptime by banning failed logins verified with
fail2ban-client status apache-phpmyadmin

Back to All Tips