Quote:
Originally Posted by porn-update
I was thinking of installing Fail2ban, but I saw that it reads Apache errors.....
But I think I didn't understand something because:
Code:
root@ubuntu-2gb-blr1-14-04-3:~# tail -f error_log|fgrep '[rewrite:'
tail: cannot open ‘error_log’ for reading: No such file or directory
root@ubuntu-2gb-blr1-14-04-3:~# LogLevel alert rewrite:trace3
LogLevel: command not found
What am I missing? How should I use this?
|
You need to find the location of the error log for that domain.
use find or locate or read the configuration file for that domain
Code:
$ cd /etc/apache2/sites-available
$ tac <domain file> |less
or from ~ of root
Code:
$ (cd /etc/apache2/sites-available && grep -i 'error\.log' <domain config file>
then when you have the location (path)
Code:
$ tac <path/to/file/error.log> |less
this will read the file starting from the last line. less is one screen at a time, space bar next page -- return next line, q is quit and close the command (tac) tac is cat backwards -- get it?
Code:
$ tac <path/to/file/error.log> egrep -i 'this|or|that' |less
$ man grep
#for more command options