Apache, to show login user
It has as to show the name of the user who effected login in a restricted page with apache (htaccess)?
|
Yes. You'll find them in your access_log with htuser name appearing instead of -
Unprotected access: 192.168.1.4 - - [09/Sep/2005:21:18:17 -0300] "GET Access by authenticated htuser 'stomach' 192.168.1.4 - stomach [09/Sep/2005:21:18:16 -0300] "GET |
You can use awk to display only htusers and what they accessed (change path as needed):
awk '$3 !~ /-/ {print $1,$3,$6,$7 }' /var/log/httpd/access_log For logrotate users with access_log.1, access_log.2 (non-gzipped), you can use this (change path as needed): for i in /var/log/httpd/access_log*; do awk '$3 !~ /-/ {print $1,$3,$6,$7 }' $i; done |
All times are GMT -5. The time now is 11:47 PM. |