Putting fail2ban in context.
If you owned a corner store and there was a local school with 2000 students just up the street, you would want to attract the school kids to your store because they could be a good source of revenue. If each student spends $5 in your store that would increase your turn over by $10,000 each day. Wow! what a corner store you would have. You are going to be rich in know time. In this scenario your site is the corner store and the school students are the visitors or traffic to your site.
But then the reality starts to sink in. 2000 kids swarm into your store every day after school. There is no room to move. They are all carrying their school bags pushing and shoving, yelling and arguing with each other. Fights break out and stock gets knocked off your shelves and broken. In the confusion little people, being people see an opportunity and stock starts to disappear in to school bags and walk out the door with out being paid for. If that continues you will be broke in know time. Similarly at your site hackers and bad bots will try to run a muck and do as much damage as they can.
So at you corner store you employ a rent-a-cop who makes the school kids enter the store in smaller groups, leave there bags outside and any who fight or try to shoplift get banned. You don’t make quite as much as you thought you would in the first instance but you don’t go broke either. You have to look at the traffic to your server in the same way. So you will need a rent-a-cop or in this case more of a download-a-cop, and that is where fail2ban comes in. Fail2ban is a small open source program that watches your log files and tells your firewall to prevent misbehaving IP addresses from accessing your server.