Author |
|
Spewed
Joined: 08 Dec 2006 Posts: 4
|
Posted: Fri 08 Dec '06 20:51 Post subject: Monitor .htaccess logins |
|
|
Hi guys, great forum!
Is there a way to monitor .htaccess logins on Apache 2.0.59? The information I would need to know is arrival timestamp, ip and the used username.
Thanks in advance. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 08 Dec '06 23:43 Post subject: |
|
|
The normal access.log logs the infos you need
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access.log common
makes
192.168.1.21 - Username [08/Dec/2006:22:39:25 +0100] "GET / HTTP/1.1" 200 2493 |
|
Back to top |
|
Spewed
Joined: 08 Dec 2006 Posts: 4
|
Posted: Sat 09 Dec '06 0:08 Post subject: |
|
|
That was too simple thing to find out.
Thanks for the quick reply! |
|
Back to top |
|
Brian
Joined: 21 Oct 2005 Posts: 209 Location: Puyallup, WA USA
|
Posted: Sat 09 Dec '06 0:22 Post subject: |
|
|
AWSTATS can display this info nicely as well. |
|
Back to top |
|
Spewed
Joined: 08 Dec 2006 Posts: 4
|
Posted: Sat 09 Dec '06 1:41 Post subject: |
|
|
Thanks for that info too, Brian.
Hmm, not sure what sort of format I should use. I only need:
192.168.1.21 Username [08/Dec/2006:22:39:25 +0100]
So I tried:
LogFormat "%h %u %t" common
But still got GET, HTTP etc. How can I get rid of the extra data to get clean log? I took a look at the Module mod_log_config documentation with no luck. |
|
Back to top |
|
Spewed
Joined: 08 Dec 2006 Posts: 4
|
Posted: Sun 10 Dec '06 11:09 Post subject: |
|
|
No one have any idea about this? |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Sun 10 Dec '06 14:52 Post subject: |
|
|
Ensure that your LogFormat directive comes just before the CustomLog directive in httpd.conf.
If there is another LogFormat directive which defines the log format common prior to the CustomLog directive, then it will take precedence over your LogFormat directive.
Another method you might consider is to put a second CustomLog directive in httpd.conf to create your own log - separate from the regular access.log file.
Code: | CustomLog logs/short_access.log "%h %u %t" |
This second CustomLog will create a second log file named short_access.log. This file will be in addition to the regular access.log file.
Note that you do not need to touch the original LogFormat directive in this case because the definition of your short format is contained within your CustomLog directive.
-tom- |
|
Back to top |
|