Score:0

fail2ban works with access logs but not error logs "Have not found any log file" Bitnami Servers

es flag

OK I am stumped...Why is it that fail2ban works perfectly fine on my ubuntu computer but on my aws bitnami stack it won't find the error_log file. It's like it hates the fact that bitnami puts the error logs in a non standard place. The access_log NO PROBLEMS fail2ban works fine but when I try anything that uses the error_log I receive the error "Have not found any log file" I can obviously verify that my error_log file in fact does exist. I look at it every day. What is going on?? Anyone experienced with fail2ban:

logpath = /opt/bitnami/apache/logs/access_log <-- WORKS!

logpath = /opt/bitnami/apache/logs/error_log <-- DOESN'T WORK??

logpath = /opt/bitnami/apache2/logs/error_log <-- DOESN'T WORK??

What gives? For now I just removed the jails that observe the error_log file so I can keep the server up and going. Any ideas, thoughts, questions? If I figure it out I'll let yall know. Thanks for any help :)

Score:1
jp flag

You will need to update the path to the error_log file in the configuration file for the jail that you are using in Fail2ban.

By default, the configuration files for Fail2ban are stored in /etc/fail2ban. You can find the configuration file for the jail that you are using by looking in the jail.d directory. For example, if you are using the ssh jail, the configuration file would be located at /etc/fail2ban/jail.d/sshd.conf.

In the configuration file, you will need to find the logpath option and update it to point to the correct path for your error_log file on the AWS Bitnami stack.

Once you have updated the configuration file, you will need to restart Fail2ban for the changes to take effect. You can do this by running

sudo service fail2ban restart

. .

Seems you already know the path to error_log but in case not or for other readers. see below.

To determine the correct path for your error_log file on the AWS Bitnami stack, you can try the following steps:

  • Connect to your AWS Bitnami stack using SSH.
  • Use the locate command to search for the error_log file. The locate command uses a database of file locations to quickly find files on the system. For example, you can try running locate error_log. This will return a list of all files on the system with "error_log" in the file name.
  • Once you have found the error_log file using the locate command, you can use the pwd command to print the full path to the file. For example, if the error_log file is located at /opt/bitnami/apache2/logs/error_log, you can run pwd /opt/bitnami/apache2/logs/error_log to print the full path.
  • Use the full path to the error_log file as the value for the logpath option in the Fail2ban configuration file.
waltmagic avatar
es flag
EXACTLY This is the answer. I actually figured out what was going on but I have been so busy with work...this post is even more informative than what I was going to post. njpdx Thank you so much for posting this answer. It was terribly frustrating and you took the time to answer it. Thank you :) Proof of good people doing good things
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.