Fail2ban works by using iptables which maintains a list of IPs which it things are malicious and it will block any inbound request from these IPs. This is a kind on negative security model. I would recommend you to use a positive security model where you should return 403 status to all the inbound requests that are not for your server name.
You should install mod_security on your apache web server and create the following rule:
SecRule SERVER_NAME "www\.yourdomain\.com$" "id:'200000',phase:1,nolog,allow,ctl:ruleEngine=off"
In case you have any problems you can change the nolog to log and see the logs to understand whats happening. Hope this helps.