Linux-Noob Forums

Full Version: how do i view .htaccess logs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

hi all

 

how can I see what ip's are accessing the .htaccess protected pages ?

 

let me know

 

cheers

anyweb


Hum, quick'n'dirty:

 



Code:
grep -v "\- \-" access.log|cut -d' ' -f1|uniq




 

Short explanation:

grep -v "\- \-" access.log: shows only access lines that are authenticated

cut -d' ' -f1: prints the first field of the space separated line (which is the IP address in the logs)

uniq: removes all duplicate IP addresses

they will turn up in the normal logs, 200 = successful login, 401 = failed login