As stated many times before, these pages are for myself just as much, if not more,
as for all you others. Therefore, notes of interest will be injected at different places.
A couple of years ago, late 2004, we decided it would be nice to know how many people were accessing our
Web Pages. We were just looking for a counter and came across this piece of work... BBclone
BBclone is a web counter written in PHP and gives a
detailed view of the visitors of your web site.
This extension consist of two independent parts:
- A snippet extension that displays the selected stats.
- A hook extension that allows tracking your pages in
BBclone.
It will display the nth last users (and the data they provided,
like their IP, browser and so on) that visited the web site, not just showing a number of
visitors. For each visitor, BBclone
can display the IP address, hostname, operating
system, robots, browser, referring URL, country, search engine keywords, hostname resolution, time statistics,
proxy workaround and display, referrer and ip address filtering. Live domo available on the website.
Ref: Big WebMaster
Install BBClone
Please follow the guidlines listed here:
BBClone Setup
Rut, Roh... Troubles
Now here it is, early to mid 2008, and our counter has ceased to work. Upon approaching our fabulous,
and very helpful ISP,
we were informed that they had moved to PHP5 and if we had been reading the e-mails they sent we would have
known that. Even though this sounds harsh in print, they were very cordial and kind about it. Matter of fact, Don and Joshua
both helped us get things straightened out and working again. Suffice it to say that we put the PHP5 version of
BBclone
out on our site, on our ISP, and still had a problem.
1. suPHP Set Up
Turns out that in addition to PHP5, my ISP, HostRocket.com, implemented suPHP for
better control and security. This "security" caused problems in BBclone
operation. This led to a search of the Net
and the BBclone forum.
Through this search I found Olliver Wichmann who had worked on BBclone
in the beginning and had some insights. He helped me to finalize the info on this page so that,
hopefully, it will be useful to someone else.
The following code applies to those using the .htaccess
method of adding the BBclone activation code to your files.
This code will cause all your pages to be counted without having to edit
all of them and manually add the counter code. However, please pay attention to the Note below this
code.
The .htaccess file changes:
suPHP_ConfigPath /home/username/
RemoveHandler .html .htm
AddHandler php5-script .htm .html
AddType application/x-httpd-php5 .htm .html
<FilesMatch "\.(html?)$">
php_value short_open_tag "Off"
php_value auto_append_file "/home/username/public_html/count.php"
</FilesMatch>
Please Note, that
suPHP_ConfigPath
is specific to
suPHP
and not available in general.
Also please note that you will have to put your own paths in. Check with your ISP.
When running suPHP, PHP is running as a
CGI binary and not an Apache module.
Therefore, an AddHandler and AddType are both needed.
suPHP options
It seems, that suPHP is used as an Apache module (whilst php is running as cgi-binary).
Therefore it might be
useful to point out that suPHP_ConfigPath is an option used by mod_suphp:
http://www.suphp.org/Documentation-Module-Configuration.en.html
RemoveHandler is only necessary in case a handler for htm(l) files has been defined in httpd.conf
or in another .htaccess of a higher directory level.
As not everyone is Apache savy, it might be useful to link to the Apache documentation explaining that directive, so those interested in more
details can study the source of your statement:
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#removehandler
Refer:
BBClone htaccess
2. Code Added to index.php
This code is to be placed at the beginning of your main, or top, index file. Usually
index.php.
<!-- Visitor counter code. Created by the Good Guys at http://www.bbclone.de -->
<?php
define("_BBC_PAGE_NAME", "XXMain");
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _bbclone_dir."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);
?>
3. The count file
The following code is placed in a file called count.php.
<?php
define("_BBCLONE_DIR", "/home/username/public_html/bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);
?>
There is also a Wiki Help Page at:
http://help.bbclone.de/ that answers a lot
of questions.
4. My Conclusion
Through all this, embarrassment on my part, it seems that in the beginning, when I was trying to be
nice and helpful, I caused these problems later. The key fix, which was added by Joshua, was the line:
AddType application/x-httpd-php5 .htm .html
I had removed this line way back when I first implemented BBclone
with the thought that it would cut down on server
processing and speed up operations. As it turns out, I was wrong.
The other key line in the fix was from Don:
suPHP_ConfigPath /home/username/