# Fail2Ban on Lighttpd

**URL:** https://dietpi.com/forum/t/fail2ban-on-lighttpd/4740
**Category:** Troubleshooting
**Created:** [18 December 2020 13:59 UTC](https://dietpi.com/forum/t/fail2ban-on-lighttpd/4740 "2020-12-18T13:59:37Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 December 2020 15:56 UTC](https://dietpi.com/forum/t/fail2ban-on-lighttpd/4740/2 "2020-12-18T15:56:07Z")

</div>

Hi,

many thanks for your message. First, you would need to configure ownCloud to log failed login attempts.

For fail2ban, you would need to specify following 2 files

```nohighlight
nano /etc/fail2ban/filter.d/owncloud.conf

```

```nohighlight
[Definition]
failregex={.*Login failed: \'.*\' \(Remote IP: \'<HOST>\'\)"}
ignoreregex =

```

and

```nohighlight
nano /etc/fail2ban/jail.d/owncloud.conf

```

```nohighlight
[owncloud]
enabled = true
port = 80,443
protocol = tcp
backend = auto
filter = owncloud
maxretry = 3
bantime = 10800
logpath = /mnt/dietpi_userdata/owncloud_data/owncloud.log

```

once done restart fail2ban

```nohighlight
systemctl restart fail2ban.service

```

Now you should see something like this

```nohighlight
root@DietPi3:~# fail2ban-client status owncloud
Status for the jail: owncloud
|- Filter
| |- Currently failed: 1
| |- Total failed: 1
| `- File list: /mnt/dietpi_userdata/owncloud_data/owncloud.log
`- Actions
   |- Currently banned: 0
   |- Total banned: 0
   `- Banned IP list:
root@DietPi3:~#

```

---

_[View the full topic](https://dietpi.com/forum/t/fail2ban-on-lighttpd/4740)._
