473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

monitoring IP's of visitors to website

Hi folks, Is there a simple way to log IP's without CGI?
I need to log the IP's of the visitors to a website I run.
I used to have a CGI script but there's no CGI on the server I'm using
now.
Thanks.

Jul 28 '06 #1
16 3232
nm****@hotmail.com said the following on 7/28/2006 2:13 PM:
Hi folks, Is there a simple way to log IP's without CGI?
No, and you can't even do it reliably with a CGI script.
I need to log the IP's of the visitors to a website I run.
You are out of luck.
I used to have a CGI script but there's no CGI on the server I'm using
now.
It's all the same as the CGI script wasn't reliable anyway.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 28 '06 #2
nm****@hotmail.com wrote:
Hi folks, Is there a simple way to log IP's without CGI?
Most webservers have built in logging facilities. The ip address the request
came from is normally part of the log entry.
I need to log the IP's of the visitors to a website I run.
The IP address the request came from might not be "the visitor's" since
proxy servers get in the way (I gather that AOL, for instance, runs all
their customers through a series of rotating transparent proxies).

Client side JavaScript has no direct access to the IP addresses (yes,
plural, my laptop often has three, this machine has two, once I regularly
used a machine with seven ip addresses) of the client.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 28 '06 #3
David Dorward said the following on 7/28/2006 4:17 PM:
(I gather that AOL, for instance, runs all
their customers through a series of rotating transparent proxies).
Yes, that is how AOL assigns proxies. Even if you have a broadband
connection and connect via the web, it still assigns a dynamic IP
Address to you as an AOL user. You still have your broadband IP but you
gain an AOL IP as well.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 28 '06 #4
nm****@hotmail.com wrote:
Hi folks, Is there a simple way to log IP's without CGI?
I need to log the IP's of the visitors to a website I run.
I used to have a CGI script but there's no CGI on the server I'm using
now.
Thanks.
On most Mozilla based browsers with Java installed you can use:
var host = java.net.InetAddress.getLocalHost();
var ip = host.getHostAddress();
However, the result probably won't be useful (mine returns the
localhost ip 127.0.0.1). Even if it was useful, where would you log it
(using javascript)? To another server?
Most webservers log user IP addresses by default, if not they can be
configured to. It will be the IP of either the client or the closest
proxy/gateway to your server.
For example, the Apache web server on *nix defaults logs to
/var/log/http/access Tomcat defaults to the log directory under the
TOMCAT_HOME directory.

Jul 28 '06 #5
Another solution that maybe applicable is to use Google Analytics. It does
not give IP addresses but does give a world map with cities with hits on.

Its pritty cool, you need a Google mail account, sign up for Anaytics and
you get an account in a few days.

Aaron
Jul 29 '06 #6
Aaron Gray said the following on 7/28/2006 8:37 PM:
Another solution that maybe applicable is to use Google Analytics. It does
not give IP addresses but does give a world map with cities with hits on.
Then how do you propose that as "Another solution" when it clearly fails
to do anything remotely close to what the OP asked for?
Its pritty cool, you need a Google mail account, sign up for Anaytics and
you get an account in a few days.
And then you can do Analytics but it will still be worthless for IP
addresses.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 29 '06 #7

Paul wrote:
nm****@hotmail.com wrote:
Hi folks, Is there a simple way to log IP's without CGI?
I need to log the IP's of the visitors to a website I run.
I used to have a CGI script but there's no CGI on the server I'm using
now.
Thanks.
On most Mozilla based browsers with Java installed you can use:
var host = java.net.InetAddress.getLocalHost();
var ip = host.getHostAddress();
However, the result probably won't be useful (mine returns the
localhost ip 127.0.0.1). Even if it was useful, where would you log it
(using javascript)? To another server?
Most webservers log user IP addresses by default, if not they can be
configured to. It will be the IP of either the client or the closest
proxy/gateway to your server.
For example, the Apache web server on *nix defaults logs to
/var/log/http/access Tomcat defaults to the log directory under the
TOMCAT_HOME directory.

Thanks. I'm not sure I understand your Java suggestion, is this a piece
of code I should put in my html?

Regarding the second suggestion, I'm not the administrator of the
webserver, I'm just managing a couple of web pages hosted on the
server. It is *nix, but I'm not sure if it's Apache, Tomcat, or
something else. There's no /var/log/http directory or $TOMCAT_HOME,
but I did find a few apache directories so I guess it's Apache. The
admin guy is on vacation...

Jul 29 '06 #8

David Dorward wrote:
nm****@hotmail.com wrote:
Hi folks, Is there a simple way to log IP's without CGI?

Most webservers have built in logging facilities. The ip address the request
came from is normally part of the log entry.
I need to log the IP's of the visitors to a website I run.

The IP address the request came from might not be "the visitor's" since
proxy servers get in the way (I gather that AOL, for instance, runs all
their customers through a series of rotating transparent proxies).

Client side JavaScript has no direct access to the IP addresses (yes,
plural, my laptop often has three, this machine has two, once I regularly
used a machine with seven ip addresses) of the client.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Thanks. Any logging would be good, even if not very accurate, I want
to have a general idea of the domain where visitors come from. see also
my reply to Paul.
Home is where the ~/.bashrc is
Jul 29 '06 #9

Randy Webb wrote:
Aaron Gray said the following on 7/28/2006 8:37 PM:
Another solution that maybe applicable is to use Google Analytics. It does
not give IP addresses but does give a world map with cities with hits on.

Then how do you propose that as "Another solution" when it clearly fails
to do anything remotely close to what the OP asked for?
Its pritty cool, you need a Google mail account, sign up for Anaytics and
you get an account in a few days.

And then you can do Analytics but it will still be worthless for IP
addresses.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Thanks guys. In fact I was already using Google Analytics. It's cool
but, as Randy says, doesn't give individual IP's.

Jul 29 '06 #10
nm****@hotmail.com said the following on 7/29/2006 2:01 PM:
David Dorward wrote:
>nm****@hotmail.com wrote:
>>Hi folks, Is there a simple way to log IP's without CGI?
Most webservers have built in logging facilities. The ip address the request
came from is normally part of the log entry.
>>I need to log the IP's of the visitors to a website I run.
The IP address the request came from might not be "the visitor's" since
proxy servers get in the way (I gather that AOL, for instance, runs all
their customers through a series of rotating transparent proxies).

Client side JavaScript has no direct access to the IP addresses (yes,
plural, my laptop often has three, this machine has two, once I regularly
used a machine with seven ip addresses) of the client.

Thanks. Any logging would be good, even if not very accurate, I want
to have a general idea of the domain where visitors come from.
And you think that "not very accurate" data will give you that general
idea without that general idea being "not very accurate"? You would be
just as "accurate" to guess where I am as you would be trying to guess
where I am based on IP address.

When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 29 '06 #11

Randy Webb wrote:
nm****@hotmail.com said the following on 7/29/2006 2:01 PM:
David Dorward wrote:
nm****@hotmail.com wrote:

Hi folks, Is there a simple way to log IP's without CGI?
Most webservers have built in logging facilities. The ip address the request
came from is normally part of the log entry.

I need to log the IP's of the visitors to a website I run.
The IP address the request came from might not be "the visitor's" since
proxy servers get in the way (I gather that AOL, for instance, runs all
their customers through a series of rotating transparent proxies).

Client side JavaScript has no direct access to the IP addresses (yes,
plural, my laptop often has three, this machine has two, once I regularly
used a machine with seven ip addresses) of the client.
Thanks. Any logging would be good, even if not very accurate, I want
to have a general idea of the domain where visitors come from.

And you think that "not very accurate" data will give you that general
idea without that general idea being "not very accurate"? You would be
just as "accurate" to guess where I am as you would be trying to guess
where I am based on IP address.

When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
well, the people accessing my websites are likely to be at some
University with a fixed IP.
Too bad if I'lI miss some accesses, if I get a % of the IP's it'll be
better than nothing.

Jul 29 '06 #12
nm****@hotmail.com wrote:
Thanks. I'm not sure I understand your Java suggestion, is this a piece
of code I should put in my html?
The short version:

* It won't work for most people
* It won't give you a helpful result for most other people
* You probably won't have any way of getting the data from the visitor's
browser to your server
Regarding the second suggestion, I'm not the administrator of the
webserver, I'm just managing a couple of web pages hosted on the
server. It is *nix, but I'm not sure if it's Apache, Tomcat, or
something else. There's no /var/log/http directory or $TOMCAT_HOME,
but I did find a few apache directories so I guess it's Apache. The
admin guy is on vacation...
Wait until he gets back. The ip addresses are almost certainly being logged
already, just ask for access to the logs.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 29 '06 #13
JRS: In article <wM******************************@comcast.com>, dated
Sat, 29 Jul 2006 15:49:52 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>nm****@hotmail.com said the following on 7/29/2006 2:01 PM:
>David Dorward wrote:
>>nm****@hotmail.com wrote:

Hi folks, Is there a simple way to log IP's without CGI?
>>>I need to log the IP's of the visitors to a website I run.
>Thanks. Any logging would be good, even if not very accurate, I want
to have a general idea of the domain where visitors come from.

And you think that "not very accurate" data will give you that general
idea without that general idea being "not very accurate"? You would be
just as "accurate" to guess where I am as you would be trying to guess
where I am based on IP address.

When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.
But he's not asking where you are; he's asking where you come from.

Wherever you happen to be, you actually are, AIUI, an EST/EDT American,
and should (according to the OP's words) be treated as such, and not as
an adventitious Bangladeshi, etc.?

I see that you have
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
IIRC, I have heard (at least months ago) that Thunderbird could use non-
FFF dates in the Attribution (I assume 20060516 is ISO date; it cannot
be BRF).

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm- also batprogs.htm.
Jul 30 '06 #14
Dr John Stockton said the following on 7/30/2006 10:57 AM:
JRS: In article <wM******************************@comcast.com>, dated
Sat, 29 Jul 2006 15:49:52 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>nm****@hotmail.com said the following on 7/29/2006 2:01 PM:
>>David Dorward wrote:
nm****@hotmail.com wrote:

Hi folks, Is there a simple way to log IP's without CGI?
>>>>I need to log the IP's of the visitors to a website I run.
>>Thanks. Any logging would be good, even if not very accurate, I want
to have a general idea of the domain where visitors come from.
And you think that "not very accurate" data will give you that general
idea without that general idea being "not very accurate"? You would be
just as "accurate" to guess where I am as you would be trying to guess
where I am based on IP address.

When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.

But he's not asking where you are; he's asking where you come from.
It is still irrelevant as the IP address for my laptop is through
Chicago, Illinois, the IP address on my desktop at work will report as
being in New York City, New York. The IP Address I have at home will
report as being in Dallas, Texas and if I open a webpage using AOL then
the IP address will suppose to you that I am in Dulles, Virginia (all in
the USA). Yet, I am not within 500 kilometers of any of those physical
locations. So no, the IP Address won't even come close to telling you
where I am, where I came from, nor where I am going.
Wherever you happen to be, you actually are, AIUI, an EST/EDT American,
and should (according to the OP's words) be treated as such, and not as
an adventitious Bangladeshi, etc.?
Perhaps, unless I am in Paris and want to read French.
I see that you have
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
Yes, that is what I have.
IIRC, I have heard (at least months ago) that Thunderbird could use non-
FFF dates in the Attribution (I assume 20060516 is ISO date; it cannot
be BRF).
It probably can, if I were so inclined to look it up and cared what
format it puts the Date in.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '06 #15
JRS: In article <Xt******************************@comcast.com>, dated
Sun, 30 Jul 2006 16:18:29 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>Dr John Stockton said the following on 7/30/2006 10:57 AM:
>JRS: In article <wM******************************@comcast.com>, dated
Sat, 29 Jul 2006 15:49:52 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>>When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.

But he's not asking where you are; he's asking where you come from.

It is still irrelevant as the IP address for my laptop is through
Chicago, Illinois, the IP address on my desktop at work will report as
being in New York City, New York. The IP Address I have at home will
report as being in Dallas, Texas and if I open a webpage using AOL then
the IP address will suppose to you that I am in Dulles, Virginia (all in
the USA). Yet, I am not within 500 kilometers of any of those physical
locations. So no, the IP Address won't even come close to telling you
where I am, where I came from, nor where I am going.
Those addresses are all, as you admit, for the USA. For any server not
providing merely local services within part of the USA, they're all
substantially equivalent.

>Wherever you happen to be, you actually are, AIUI, an EST/EDT American,
and should (according to the OP's words) be treated as such, and not as
an adventitious Bangladeshi, etc.?

Perhaps, unless I am in Paris and want to read French.
Why should you want to read French only if you are in a francophone
location? If you are in France, PQ, &c., you may want to read local
material; but you will want to read it in whichever language is most
comprehensible, independently of your actual location (unless you're a
Secret Agent pretending to be a Local Person). And you might wish to
read French before you go there, to refresh your putative capability
before you leave the USA. FYI, the book I most recently read was in
French, and dealt with an early trip to America (and back via
Scandinavia).

If more than one language is available for the desired material, the
client should be allowed to choose personally.

>IIRC, I have heard (at least months ago) that Thunderbird could use non-
FFF dates in the Attribution (I assume 20060516 is ISO date; it cannot
be BRF).

It probably can, if I were so inclined to look it up and cared what
format it puts the Date in.
It's a matter of whether you wish to appear to care for your readers,
most of whom find FFF dates uncongenial and in an appreciable fraction
of cases misleading. Though your use of the 12-hour clock does suggest
fairly strongly that the date may also be weird.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/- w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/- see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 31 '06 #16
Dr John Stockton said the following on 7/31/2006 7:41 AM:
JRS: In article <Xt******************************@comcast.com>, dated
Sun, 30 Jul 2006 16:18:29 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>Dr John Stockton said the following on 7/30/2006 10:57 AM:
>>JRS: In article <wM******************************@comcast.com>, dated
Sat, 29 Jul 2006 15:49:52 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>>>When I am on my laptop it uses a wireless satellite connection and I get
the same static IP address whether I am in Bangladesh, New York City, or
Cape Town South Africa so knowing my IP address won't tell you where I am.
But he's not asking where you are; he's asking where you come from.
It is still irrelevant as the IP address for my laptop is through
Chicago, Illinois, the IP address on my desktop at work will report as
being in New York City, New York. The IP Address I have at home will
report as being in Dallas, Texas and if I open a webpage using AOL then
the IP address will suppose to you that I am in Dulles, Virginia (all in
the USA). Yet, I am not within 500 kilometers of any of those physical
locations. So no, the IP Address won't even come close to telling you
where I am, where I came from, nor where I am going.

Those addresses are all, as you admit, for the USA.
I did not say they were "for" the USA, only that they are "in" the USA.
The difference is quite substantial. With a proper satellite connection
you can even use the one in Chicago while in London. So no, they are not
for the USA even though they are in the USA.
For any server not providing merely local services within part of the USA,
they're all substantially equivalent.
So you admit that knowing an IP Address, and where it originates, is
totally useless? Otherwise, they can't be "substantially equivalent".

>>Wherever you happen to be, you actually are, AIUI, an EST/EDT American,
and should (according to the OP's words) be treated as such, and not as
an adventitious Bangladeshi, etc.?
Perhaps, unless I am in Paris and want to read French.

Why should you want to read French only if you are in a francophone
location? If you are in France, PQ, &c., you may want to read local
material; but you will want to read it in whichever language is most
comprehensible, independently of your actual location (unless you're a
Secret Agent pretending to be a Local Person).
Or you are a student wanting to practice the language, or you are a
traveler wanting to practice the language, or you are a Usenet poster
giving a positive example of why the IP Address is totally useless.
And you might wish to read French before you go there, to refresh your
putative capability before you leave the USA.
Perhaps, perhaps not.
FYI, the book I most recently read was in French, and dealt with an
early trip to America (and back via Scandinavia).
I am sure that somehow that means something to you with relation to IP
Addresses but it doesn't me.
If more than one language is available for the desired material, the
client should be allowed to choose personally.
Precisely and the IP Address sure isn't a way to try to determine that
language. And that only goes to reinforce what I said to start with.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 2 '06 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sven Dzepina | last post by:
Hi All, how I can make a simply HostWatch - system which use a mysql DB and send me an e-Mail if the Server goes off and again on? I began to programm this last night, but the MySQL inquiry is...
3
by: Juha Suni | last post by:
I was faced with a difficult configuration issue a few days ago with another companys web service. In short, their web service requires the user to login on their page before their service can be...
4
by: Paul Lee | last post by:
Hi, I posted a question to this forum a few days ago and got a veyr good response - unfortunately I asked the wrong question (I asked about referring domains, not IPs of visitors). I've got a...
6
by: Randal | last post by:
Does anyone have a code sample of how one would "listen" to a TCP/IP session between an application on the local machine and a remote host. I'm looking for code that would allow me to specify a...
2
by: Benny | last post by:
Hi, A client of us asked to write a script to View live visitors as they browse her website and to get the information such as, what page they are viewing, what browser type they are using, IP...
0
by: ip2location.inc | last post by:
IP2Location has announced the availability of IP2Location .NET Component, that enables application developers to geolocation the Internet visitors by IP Address from their .NET applications. ...
7
by: mojtaba_danai | last post by:
Hi Hope that some one can help with the following. I wish to write a Visual C++ program, which monitors 3-4 other services (process/programs also written in VC++). The program shall monitor, if...
3
by: Lad | last post by:
I would like to record visitor's IP address.How can I do that in Python? Thanks for help L
6
by: kokowawa | last post by:
Hello there, I have a PHP-based webpage using MySql. I want to store the IP-adresses of the visitors into DB and when it's a new visitor (ip) the start page will show an extra image (or pop up)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.