LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-07-2010, 07:27 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
Site monitoring help needed


Hi
I have developed a website. Now i would like to monitor the IP address of machines who are accessing the server.
The simplest possible solution to this that comes first into my mind is to use jsp inbuilt tags.
Code:
<%
out.print( request.getRemoteAddr() );
out.print( request.getRemoteHost() );
%>
but it has given me some other IP address(May be a proxy server's ip address)

So i was left with one choice is to run netstat on host server .
Here is what i have done.

Code:
netstat -an | grep 8080 (As tomcat runs on port 8080).
Should i modify the command or there is any other way around to monitor the IP address?

Last edited by pinga123; 05-07-2010 at 07:28 AM.
 
Old 05-07-2010, 08:54 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 97
The easiest way to do this is to look at the access logs.

Incidentally, if someone is using a proxy, the proxy address is all
you'll see. And if it is a caching proxy, you won't even know how
many hits were made to the proxy.
 
Old 05-07-2010, 08:59 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
It is I guess even possible to get the addresses behind the proxy. I have seen some web sites collecting this data. One of my colleagues did that incidentally for one of our web applications.
 
Old 05-07-2010, 10:03 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
You can sometimes (usually?) get the proxy-hidden IP by looking for the 'X-Forwarded-For' HTTP header in the request.

Dave
 
Old 05-08-2010, 12:56 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Exactly. But I would like to see if this field has been disabled in squid, will this still work?
 
Old 05-08-2010, 02:19 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,829

Rep: Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409
i would install " awstats" and use it's output.

for the "hidden" ip's you can sett Apache to do a dns on EVERY call but there is a speed trade off .The site WILL get slow.

Last edited by John VV; 05-08-2010 at 02:21 AM.
 
  


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
LXer: Site News And Simple Oracle Monitoring For Linux And Unix LXer Syndicated Linux News 0 01-11-2009 11:11 PM
web site monitoring packetsmacker Linux - Networking 10 07-31-2008 08:52 AM
megaraid_mbox monitoring tool needed! yuri_d Red Hat 2 03-21-2008 03:17 PM
Snmp disk monitoring help needed investmentbnker75 Linux - Newbie 11 02-19-2008 08:15 AM
Net monitoring tool needed Adony Linux - Software 2 06-30-2004 07:58 AM


All times are GMT -5. The time now is 04:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration