mirror of
https://github.com/SubleXBle/Fail2Ban-Report.git
synced 2026-02-12 03:38:45 -06:00
3.0 KiB
3.0 KiB
Fail2Ban-Report Automatic Installation Guide
Overview
This installer script automates the setup of the Fail2Ban-Report tool by performing the following tasks:
- Cloning or downloading the repository
- Installing required dependencies (
jq) - Setting up shell scripts in a dedicated directory
- Configuring file permissions and ownership
- Optionally installing cronjobs for automated data processing and firewall updates
Prerequisites
- Linux server with Bash shell
gitcommand (preferred) or fallback towgetandunzipjqJSON processor utility- Sudo or root privileges for installation and configuration
- Web server (e.g. Apache or Nginx) serving the chosen web directory
Installation Steps
-
Run the Installer Script
Execute the installer script in your shell:
wget https://raw.githubusercontent.com/SubleXBle/Fail2Ban-Report/main/Installer.sh && chmod +x Installer.sh && ./Installer.sh && rm Installer.sh
-
Specify Installation Paths
When prompted:
- Enter the web root directory where the Fail2Ban-Report web files will be installed (default:
/var/www/html) - Enter the directory to store shell scripts (default:
/opt/Fail2Ban-Report)
- Enter the web root directory where the Fail2Ban-Report web files will be installed (default:
-
Repository Setup
- If
gitis installed, the repository will be cloned or updated in the target web directory - If
gitis not available, the installer offers to download a ZIP archive viawgetand extract it
- If
-
Dependency Installation
- The script checks for
jqand offers to install it via your package manager (apt,dnf, orpacman) - If declined or unsupported, installation will stop
- The script checks for
-
Shell Scripts Deployment
fail2ban_log2json.shandfirewall-update.share copied to the chosen shell script directory- Executable permissions are set (
chmod +x) - Script variables are updated to point to the correct archive and blocklist paths
-
Permissions
- The web directory ownership is set to
www-data:www-datarecursively
- The web directory ownership is set to
-
Cleanup
- Shell scripts are removed from the web directory after copying
- The installer script removes itself after successful installation
-
Cronjobs
- You will be prompted to install a daily cronjob for
fail2ban_log2json.sh(default 3 AM) - You can select a schedule for
firewall-update.sh(every 5 or 15 minutes or skip installation)
- You will be prompted to install a daily cronjob for
Notes
- Make sure your web server is configured properly to serve the Fail2Ban-Report directory
- Adjust your
.htaccessfile for security; an example is included in the repository - Both shell scripts (
fail2ban_log2json.shandfirewall-update.sh) should not reside in the web root for security reasons - Cronjobs must run as root for proper operation, especially for firewall updates
Usage
- Run the cronjobs regularly to keep your Fail2Ban-Report data and firewall rules updated automatically
- Access the web interface at
https://yourdomain.tld/Fail2Ban-Report/after installation
Thank you for using Fail2Ban-Report!