logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Monitor .htaccess logins
Author
Spewed



Joined: 08 Dec 2006
Posts: 4

PostPosted: Fri 08 Dec '06 20:51    Post subject: Monitor .htaccess logins Reply with quote

Hi guys, great forum! Cool

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

PostPosted: Fri 08 Dec '06 23:43    Post subject: Reply with quote

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

PostPosted: Sat 09 Dec '06 0:08    Post subject: Reply with quote

That was too simple thing to find out. Mr. Green

Thanks for the quick reply!
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Sat 09 Dec '06 0:22    Post subject: Reply with quote

AWSTATS can display this info nicely as well.
Back to top
Spewed



Joined: 08 Dec 2006
Posts: 4

PostPosted: Sat 09 Dec '06 1:41    Post subject: Reply with quote

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

PostPosted: Sun 10 Dec '06 11:09    Post subject: Reply with quote

No one have any idea about this? Confused
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Sun 10 Dec '06 14:52    Post subject: Reply with quote

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


Reply to topic   Topic: Monitor .htaccess logins View previous topic :: View next topic
Post new topic   Forum Index -> Apache