View Single Post
Old 09-20-2017, 04:52 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Quote:
Originally Posted by porn-update View Post
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
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote