LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-10-2007, 03:22 AM   #1
javedmk80
LQ Newbie
 
Registered: Sep 2007
Location: Pakistan
Distribution: Red Hat Enterprise Linux 4.0 AS. CentOS 4.5, CentOS 5.0
Posts: 11

Rep: Reputation: 0
How to log Apache server hits?


Hello list:

I need to know is there any software that can monitor the number of hits (server load) to my Apache web server on CentOS 5? alongwith their IPs? (if possible)

Or in other words, Is there any such command to check real time server-hits (or server load, whichever is correct term)?

Thank you for your support

Last edited by javedmk80; 12-10-2007 at 03:26 AM.
 
Old 12-10-2007, 08:36 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 267Reputation: 267Reputation: 267
There's webalizer.

Or create your own script really, the apache log is fairly straight forward.

Usually the logs always start out with the IPAddress, you could do something like this to get the number of unique IP's that visited:

cat /var/log/httpd/access_log | cut -d" " -f1 | sort -n | uniq | wc -l

Or if you want total number of hits, take the uniq out:

cat /var/log/httpd/access_log | cut -d" " -f1 | sort -n | wc -l

Take the wc -l off at the end like this to get all the IPAddresses that have visited your site:

cat /var/log/httpd/access_log | cut -d" " -f1 | sort -n | uniq

Get creative or use something like webalizer like mentioned.
 
Old 12-10-2007, 09:50 AM   #3
complich8
Member
 
Registered: Oct 2007
Distribution: rhel, fedora, gentoo, ubuntu, freebsd
Posts: 104

Rep: Reputation: 17
how about ...
tail -f access_log

how about enabling the /server-status url for your ip?
 
Old 12-11-2007, 05:02 AM   #4
javedmk80
LQ Newbie
 
Registered: Sep 2007
Location: Pakistan
Distribution: Red Hat Enterprise Linux 4.0 AS. CentOS 4.5, CentOS 5.0
Posts: 11

Original Poster
Rep: Reputation: 0
Hi,

Thank you both trickybird and Complich8 for your support.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 10:43 AM
source port 80 hits my iptables and fills my log dir gabsik Linux - Security 1 09-15-2006 06:08 AM
How many simultaneous hits could my server sustain? linuxhippy Slackware 5 03-16-2006 05:11 PM
How to log conversation between server in /var/log/messages? juris Linux - Software 1 11-23-2004 09:54 AM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration