View Full Version : Need help finding a Hit counter for a webpage
avryco
02-09-2008, 05:12 PM
If I Busted You Out Click Here*
I put the stars in so it wouldn't post
^thats the format that the page accepts. Sorry i don't know the name lol. I just want a hit counter that will count the page views, so if someone could find one or make me one that would be amazing
BLiZZaRD
02-09-2008, 06:53 PM
If you want a hit/stat counter there is none better than bbclone (http://bbclone.de/). This thing records everything, tells you everything and is secure, accurate and detailed. It will tell you everything about the visitor except their mothers maiden name (but I think that is coming in the next release :p )
If your server is php enabled I would go with this one. It's fairly easy to set up as well.
Aaron
02-11-2008, 03:06 AM
Thank-you for the advice. I just installed. looks nice. I had been doing a little storage in my database ... prefer this little application instead.
Need to learn more about setting up security so only I can access the logs (perhaps will have to add password to the /bbclone folder via .htaccess ?). Also to learn how to delete data from logs ... get rid of my testing. I like how it has a large following and lots of forum posts ... good sign my questions have already been answered.
BLiZZaRD
02-11-2008, 03:59 PM
I use .htaccess for password protection in that logs folder as well.
Also if you open the conf/config.php you will see all your little "can-dos" near the end you will find
$BBC_KILL_STATS = ""
Change it to
$BBC_KILL_STATS = 1;
Save and reupload, then visit any page that has the counter code on it.
This will reset everything. Once reset, go back and change the 1 to "" again.
Aaron
02-11-2008, 05:21 PM
I got the /bbcode folder password protected now via htaccess.
Something been nagging me for a while. If I forget to type https:// and only type the http:// then the IE will warn me about sending password over insecure connection. I actually like that warning. Want to get in habit of using https since I do coffee shop internet access and with wifi connection. Yes, I do have ssl on my shared host account so it's cool with encryption.
Do you know correct .htaccess directive to force the https:// page whenever the http:// page is requested? It's probably possible. I just don't know .htaccess (mod rewrite) well.
Thanks again.
Master_script_maker
02-11-2008, 08:50 PM
redirects http://www.yoursite.com/anything and http://yoursite.com/anything to https://www.yoursite.com/anything.
RewriteEngine On
RewriteRule ^(.*)?$ https://www.YourSite.com/$1 [R=301,L]
Aaron
02-11-2008, 09:35 PM
Hey, thanks a lot for the reply
I put this in the .htaccess of folder /adminfolder and it isn't happy. Getting FF message "The page isn't redirecting properly" And yea, the "domain" is switched with my real domain, and the "adminfolder" is being changed with my real adminfolder.
#redirects http://www.domain.com/adminfolder/*anything*
# and http://domain.com/adminfolder/*anything*
# to https://www.domain.com/adminfolder/*anything*
RewriteEngine On
RewriteRule ^(.*)?$ https://www.domain.com/adminfolder/$1 [R=301,L]
It seems like the url is being change correctly, just the error stops page from loading? Any other ideas?
Aaron
02-12-2008, 05:34 AM
I see there is issue with BBClone. The data file gets large and then PHP is slow, or not able to handle it and page won't load. I'm on shared host that has some strict user limit on cpu time. Worried this will be an issue.
I also see the dang BBClone wiki (http://help.bbclone.de/) pages are having errors, if page loads at all. I suspect this is an issue with the counter, not with the wiki. Kinda worrisome. I never want to see that error on my website.
Parse error: parse error, unexpected $ in /usr/local/www/help/stats/var/access.php on line 25521
Also, the referrer doesn not seem to be working? Read something about that, said something about include() messes with the referrer. Can't seem to understand why? This works in my php script
$referer = $_SERVER['HTTP_REFERER'];
right next to the BBClone include stuff. For some reason the BBClone isn't recording referrer. Hmm. Gonna do some more forum searching.
http://forum.bbclone.de/index.php/m/6022/794292dbec7a29d493aac5bf1f40505d/?srch=referrer#msg_6022
I think I should archive my data by CRON. Somehow tar and gzip the /var directory? Any thoughts? Also, think I better turn off automatic IP DNS lookup cause that would slow down page load too. What do you suggest? I tried to register to their forum, but that seems also kinda flaky. Still waiting for the registration email.
I see there is way to include the data from /access inside my PHP pages. That is neat feature. I was very happy about this application, but now getting worried it is not able to scale? Would you discuss your experience with it?
BLiZZaRD
02-12-2008, 03:07 PM
Their site is written by someone outside the counter team. I see their parse error all the time, something with the German in the php it counts hits and then updates hits but the "re" direct doesn't initiate. If you refresh the page it works straight away. This won't affect your page/site, unless you code like them ;)
I am not sure what your limits are but I have never had time out problems because of code. I have every option turned on, have detailed stats set at 600, IP/DNS works and I have never had an issue with something not working.
All I do is check their site about once a month or so and make sure I have the latest updated files. (I didn't even know they had a forum :p ) Been using it since June of 2005, only had one issue and that was in November of '05, since then I stay updated and no issues.
Also heard that when you get a high count (they defined high as over 500,000) it can stop working, or something. I currently have over 4 million unique hits and 33 million page hits, and it keeps clicking over.
Master_script_maker
02-12-2008, 05:33 PM
Hey, thanks a lot for the reply
I put this in the .htaccess of folder /adminfolder and it isn't happy. Getting FF message "The page isn't redirecting properly" And yea, the "domain" is switched with my real domain, and the "adminfolder" is being changed with my real adminfolder.
#redirects http://www.domain.com/adminfolder/*anything*
# and http://domain.com/adminfolder/*anything*
# to https://www.domain.com/adminfolder/*anything*
RewriteEngine On
RewriteRule ^(.*)?$ https://www.domain.com/adminfolder/$1 [R=301,L]
It seems like the url is being change correctly, just the error stops page from loading? Any other ideas?
try:
RewriteEngine On
RewriteRule ^(/)?(.*)?$ https://www.domain.com/adminfolder$1$2 [R=301,L]
Aaron
02-12-2008, 08:03 PM
It is so close but no cigar. This second rule wasn't adding the "/" (without quote) after adminfolder. So that was no-good. Added the "/" in rule and it was then acting just like your first rule. Changing the URL correctly, yet the page would not load. Gives that dang "The page isn't redirecting properly" message. Hmmm. Will try another if you can think of some more possibilities. Could it be the conversion to SSL encryption that is hanging up FF? Thanks for the help in any event. Much appreciated. I'd be lost without your help.
And appreciate the info about the BBClone installation. I'm less worried now. Will still do the Cron backup thing, and report in this thread about setup. Am curious how your folder bbclone/var looks? What are file sizes. Should I set up tar the folder and then gzip everything, or is it just a matter of backup the access.php file in that folder. Which would be helpful if the overload errors start appearing? I mean, don't mind setting cron job to backup or rename the file, replace with blank file, every month or every year if that's all required to keep the filesize buggy-be-gone. Again, thanks for the info.
BLiZZaRD
02-12-2008, 08:23 PM
In my var folder access.php is 227KB and last.php is 127KB all others are 0 :) You can back them up, I wouldn't worry about resetting them to 0 every month, or gzip, unless you just want to.
In the event it goes buggy just delete them and upload your latest ones. That's what I did Nov. '05 and it worked fine.
Aaron
02-14-2008, 12:25 AM
Hey Blizzard, thanks for the help. Just created a php file (backup_bbclone_data_files.php) that is executed via cron everyday in middle of night. It even sends an informative email.
cron command is (you'll have to adjust yours per your server)
/ramdisk/bin/php4 $HOME/backup/bbclone_data_backups/backup_bbclone_data_files.php
You probably already have something like below php file, named "backup_bbclone_data_files.php". This might be handy for next person who stumbles upon this forum looking for counter. Will need to adjust the email and domain and folder locations to your server setup.
<?php
// ------------------------------
// Script to backup the two data files for BBClone:
// /bbclone/var/access.php & /bbclone/var/last.php
// should be executed by cron and saved in folder:
// /../backup/bbclone_data_backups/
// with a new name including the date to differentiate files.
// ------------------------------
// Values for my server account
$emailaddress = "email@domain.com";
// today date
$todaydate = date("ymd");
// original and destination (wihout the .gz) filenames
$orig_filename1 = "/home/myfolder/public_html/bbclone/var/access.php";
$dest_filename1 = "/home/myfolder/backup/bbclone_data_backups/access.php_" . $todaydate; // year-month-day format
$orig_filename2 = "/home/myfolder/public_html/bbclone/var/last.php";
$dest_filename2 = "/home/myfolder/backup/bbclone_data_backups/last.php_" . $todaydate; // year-month-day format
// deletes the file if it already exists
if ( file_exists($dest_filename1) ) unlink($dest_filename1);
if ( file_exists($dest_filename2) ) unlink($dest_filename2);
// Perform copy and then gzip
system("cp " . $orig_filename1 ." ". $dest_filename1, $result1); // copy file adding the date in filename
system("gzip " . $dest_filename1, $result2); // will gzip file and add the .gz extension
system("cp " . $orig_filename2 ." ". $dest_filename2, $result3); // copy file adding the date in filename
system("gzip " . $dest_filename2, $result4); // will gzip file and add the .gz extension
//system("cp access.php ~/backup/bbclone_data_backups/access.php_080213",$result1);
//system("gzip ~/backup/bbclone_data_backups/access.php_080213",$result2);
//system("cp last.php ~/backup/bbclone_data_backups/last.php_080213",$result3);
//system("gzip ~/backup/bbclone_data_backups/last.php_080213",$result4);
// Analyze destination files and send email confirmation
$size1 = filesize($dest_filename1.".gz");
switch ($size1) {
case ($size1>=1048576): $size1 = round($size1/1048576) . " MB"; break;
case ($size1>=1024): $size1 = round($size1/1024) . " KB"; break;
default: $size1 = $size1 . " bytes"; break;
}
$size2 = filesize($dest_filename2.".gz");
switch ($size2) {
case ($size2>=1048576): $size2 = round($size2/1048576) . " MB"; break;
case ($size2>=1024): $size2 = round($size2/1024) . " KB"; break;
default: $size2 = $size2 . " bytes"; break;
}
$message = "The bbclone data file backup has been run.\n\n";
$message .= "The return code for cp of access.php was: " . $result1 . "\n";
$message .= "The return code for gzip of access.php_".$todaydate." was: " . $result2 . "\n";
$message .= "The return code for cp of last.php was: " . $result3 . "\n";
$message .= "The return code for gzip of last.php_".$todaydate." was: " . $result4 . "\n\n";
$message .= "The file path of access.php_".$todaydate.".gz is: " . $dest_filename1 . "\n";
$message .= "The file path of last.php_".$todaydate.".gz is: " . $dest_filename2 . "\n\n";
$message .= "Size of access.php_".$todaydate.".gz file: " . $size1 . "\n";
$message .= "Size of last.php_".$todaydate.".gz file: " . $size2 . "\n\n";
$message .= "Server time of the backup: " . date(" F d h:ia") . "\n\n";
mail($emailaddress, "bbclone data backup was complete" , $message, "From: Website <>");
?>
I still need to figure out my .htaccess aside issue.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.