View Full Version : NOOB wanting to log ip addresses
yamaharider848
07-14-2008, 06:41 AM
i want to know how to mabe build a html page and put a code in it that tracks ipaddreses that goes on it
mabe not html but idunno
please help
if ya want addme on msn Yamaharider848@live.com
tyanque
07-14-2008, 11:52 AM
This cannot be done with HTLM as it cannot pick up IP addresses and save them as it does not have write functions, this could be done with PHP or ASP. I you google IP Logging PHP im sure you'll be able to find a free script. Hope this helps.
gnomeontherun
07-14-2008, 02:46 PM
Your server logs should be able to display this information, have you checked there before trying to setup another logging system?
binaryWeapon
07-14-2008, 04:08 PM
Yes try checking your CPANEL, often they have preinstalled scripts similar to what you need. If not, a quick google can get your code quite easily, just search for what tyanque said, "IP Logging PHP".
GL!
Len Whistler
07-14-2008, 05:17 PM
i want to know how to mabe build a html page and put a code in it that tracks ipaddreses that goes on it
mabe not html but idunno
please help
if ya want addme on msn Yamaharider848@live.com
Study PHP. Below are php functions that will read the IP address and the website your visitor came from, very usefull.
$_SERVER['REMOTE_ADDR'];
$HTTP_SERVER_VARS['HTTP_REFERER'];
You then can use php to write this information to a database or txt file, I use just a simple txt file.
-----------------
ramm19
07-15-2008, 05:21 PM
In PHP the best way is to use "$_SERVER['REMOTE_ADDR']" as Len said...
You may want to track more specific user actions other than just visiting your website (a whole bunch of IPs won't tell you much), unless you are going to couple it with $_SERVER['HTTP_REFERER'] to see what SEs bring to your website.
Quinch
04-08-2009, 03:31 AM
I found this thread via search, it seems to be what I am looking for, I want to log IP's as well as the username used to get at that page.
I have content that I can charge for access to. If possible I would like to use cPanel to password protect the directory with the pages in question, give out usernames and passwords to whomever would like to obtain one but I want to know about it if that username and password combination has been given out on the net etc.
It seems the easiest (in fact maybe the only) way to find this out is by logging the IP of the computer used with that user and pass combi. If the IP changes wildy from country to country within 24 hours I am assuming this would be a smoking gun.
Can anyone advise me if this is possible via the server logs ? And if not then maybe a suggestion as to how this can be accomplished ?
Many Thanks.
maxgxl
04-08-2009, 07:06 AM
quinch, how are you getting the usernames? By a php etc form or from apache/http authentication?
Quinch
04-08-2009, 02:15 PM
apache/http I guess.. I am creating the user / pass for them via cPanel.
I am just password protecting (via cPanel) the directory where all the pages are located. This stops just anyone from accessing the pages but I don't think the IP will be associated with the use of the name / pass (even in the server logs) so I will have no way of checking that they are not abusing the privilege by giving out their user / pass to all and sundry.
Basically I need a way to check (manually via a text doc or log is fine) what IP is using what username / pass.
I don't mind doing it an entirely different way if the above method is useless for my requirements but I don't know how and would like some advice, hence my question here :) If I can carry on the same way as above however but with a small tweak to the process somewhere then so much better.
oesxyl
04-08-2009, 02:25 PM
apache/http I guess.. I am creating the user / pass for them via cPanel.
I am just password protecting (via cPanel) the directory where all the pages are located. This stops just anyone from accessing the pages but I don't think the IP will be associated with the use of the name / pass (even in the server logs) so I will have no way of checking that they are not abusing the privilege by giving out their user / pass to all and sundry.
Basically I need a way to check (manually via a text doc or log is fine) what IP is using what username / pass.
I don't mind doing it an entirely different way if the above method is useless for my requirements but I don't know how and would like some advice, hence my question here :) If I can carry on the same way as above however but with a small tweak to the process somewhere then so much better.
cpanel -> Logs -> Latest Visitors to see logs on line, last 300 probably
or
cpanel -> Logs -> Raw Acces Log, check the "Archive Logs in your home directory at the end of each stats run [ [every 1 day(s)]] " click on Save and download them when you need/want.
best regards
Quinch
04-10-2009, 02:38 AM
Hi, thanks for your response, I tried both methods you suggested but niether has a record of the username used, the IP's were there but it is essential that I can check which username is being used by which IP.
Is this possible with cPanel features ? If not could I respectfully ask for some advice on the easiest way to achieve this ?
oesxyl
04-10-2009, 07:37 AM
Hi, thanks for your response, I tried both methods you suggested but niether has a record of the username used, the IP's were there but it is essential that I can check which username is being used by which IP.
Is this possible with cPanel features ? If not could I respectfully ask for some advice on the easiest way to achieve this ?
see second and third position in combined log format:
http://httpd.apache.org/docs/2.2/logs.html
also read the notes and warnings.
you can't do something more complicated without adding some code or scripts.
best regards
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.