![]() |
|
Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - Printable Version +- Free VPS Discussion (//freevps.us) +-- Forum: Free VPS Discussion (/forum-1.html) +--- Forum: Help & Support (/forum-2.html) +--- Thread: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath (/thread-4088.html) |
Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - Kaloy - 02-28-2012 07:13 PM As I'm already running Fail2Ban configured as per my tutorial for additional security on SSH. I decided to use it to for securing Apache as well. So I edited its configuration file to enable the filter for Apache BadBots and point it to where my web site logs are: # vi /etc/fail2ban/jail.confhere's the part of the configuration file that I updated: Code: ...# service fail2ban restartBut, upon checking on its logfile I found out that something went wrong and the filter for Apache BadBots did not actually started: # tail /var/log/fail2ban.logI've Googled regarding the error message but did not find anything related to this problem. I dont know if most people here are using Fail2Ban but I'm still hoping that someone here could help, TIA. RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - f8ll - 02-29-2012 12:23 PM This is a shot in the dark but does the user running fail2ban have permission to write to /home/demo/public_html/mydomain.com/log/access.log ? RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - DeathProxy - 02-29-2012 12:51 PM I'm also not sure about this (this may or may not be the problem), but I saw that in: 2012-02-28 16:31:07,621 fail2ban.comm : WARNING Invalid command: ['set', 'apache-badbots', 'addlogpath', '/home/demo/public_html/mydomain.com/log/access.log'] Is it supposed to be fail2ban.comm or fail2ban.com? RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - ninetailfox97 - 02-29-2012 02:43 PM probably .com RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - Kaloy - 02-29-2012 04:47 PM @f8ll Yes, I've already compared this with the SSH log file that is working with Fail2Ban SSH filter: # ls -l /var/log/secureFail2Ban process is run by root: # ps aux | grep fail2banFile permission for the Apache web site log: # ls -l /home/demo/public_html/mydomain.com/log/access.log @DeathProxy and ninetailfox97 I dont think there is a configuration to change the ".comm" on the fail2ban.log, since that is the way Fail2Ban was programed to write his log. I think its an abbreviation of "command", see below some more lines from the log file: # tail /var/log/fail2ban.log This is really mysterious for me as I don't know anymore where to look for what's causing the problem. I will really give rep. to who ever could help me solve this. RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - DeathProxy - 02-29-2012 04:53 PM Just saying, offering reputation points isn't the reason that most people help other people. Anyhow, Fail2Ban seems to be trying to look for the logs in the wrong spot. It's looking for the logs here: Quote:/home/demo/public_html/mydomain.com/log/access.log But your logs appear to be here: Quote:/home/demo/www/mydomain.com/log/access.log RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - Kaloy - 02-29-2012 05:04 PM Sorry, that was just a test directory, I tried to re-create the directory tree when I was testing/isolating if the problem was on the file permission. Edited now, to reflect the correct one. RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - DeathProxy - 02-29-2012 05:05 PM Is it working now? 999th Post!
RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - Kaloy - 02-29-2012 05:29 PM Nope, re-creating my web site directory tree just confirmed that the problem was not on the files permission. RE: Fail2Ban - Apache BadBots - WARNING Invalid command addlogpath - DeathProxy - 02-29-2012 05:40 PM I'm sorry, I've never used Fail2Ban before. Can't help you with this. |