HTTP servers will log each request that comes in. As an example, a weblog entry might look like: 192.168.0.1 - - [23/Jul/2001:15:00:34 -0500] "GET /banner.html HTTP/1.0" 304
This example means that the browser at 192.168.0.1 requested the page banner.html at the time noted above. The response from the webserver was '304', which means 'no changes to the file, use your local (cached) copy'
For example, on our webserver at work (the one that runs www.mywinnipeg.com) the only way to get to this webserver is to know the telnet adress, port, username and password. Then you need to know where to find the log, and since it's Solaris, you tail the log file, and you can actually see the screen scroll as the requests come in.
If you're on a Windows LAN, then if you have file sharing turned on, yes they will see the file if it's under a folder that is shared.
As far as the logs being browsable from the web, no this is not (normally) possible.
Webservers usually have a doc-root folder, and only folders UNDER this directory are accessible through HTTP. But the log files will not be under this directory (or sure shouldn't be!).
Dear mike, thanx for your reply, what u said to be true and its not easy to access the log with http request. Actually i want the hits of a page, like i say http://www.myhomepage.com/../*.html , in my program if i give the URL , is there a way to get the number of hits of that page.Assume that i am not the owner of that page. regards prabhakar.
You would write a program (probably in Perl) that would strip through the weblog looking for that particular page. Each time your program sees an instance of that request (a string comparison), it would increment a counter.
I say Perl, because Perl was written for exactly this kind of work and is highly optimized for string matching. Also, all the programs here at work (the ones for this kind of thing) are written in Perl.
This program (in Solaris or Unix) would run on the crontab (a part of the OS that is like the Windows Scheduler). Each day at a set time, the crontab will run your little perl program against the log. The perl program can do whatever you want it to do, including stuffing the results in a database, or emailing you the results.
And yes, all that can be done with a java program too.
There are also several products you can purchase that will do this sort of thing for you. 'Webtrends' is one that we use at work. [This message has been edited by Mike Curwen (edited October 21, 2001).]
Dear mike, thanx for the reply but i request for a more clear answer. i can look for a regular time execution but i want the page hot counts, could you plz help me in that. If you have any code that could will help me will be highly appriciated.(preferable in java). You said about the products, can i have an url where i can download that software. many thanx prabhakar
You'll notice that someone posted a link to another thread on this site, that shows you another method. The thing with the second method (variable inside servlet), is that on server restart, the count is lost.
Webtrends is about reporting hits 'after the fact'. One thing I should mention about it.. it is NOT cheap software. And as for the URL... it's amazing how many times www.insertProductNameHere.com works.
Dear mike, I dont mean how do i dispaly a hit count on the page. I mean how do i retrive the page hit count. I am not the owner of the page. say for example, Using my program i want to get the hits of javaranch home page. Is this possible. thanxs prabhakar.