LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 06:27 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
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 06:28 AM.
 
Old 05-07-2010, 07:54 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
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, 07:59 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 09:03 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

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

Dave
 
Old 05-07-2010, 11:56 PM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 01:19 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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 01:21 AM.
 
  


Reply



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 10:11 PM
web site monitoring packetsmacker Linux - Networking 10 07-31-2008 07:52 AM
megaraid_mbox monitoring tool needed! yuri_d Red Hat 2 03-21-2008 02:17 PM
Snmp disk monitoring help needed investmentbnker75 Linux - Newbie 11 02-19-2008 07:15 AM
Net monitoring tool needed Adony Linux - Software 2 06-30-2004 06:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:17 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