A new attempt to get web-site counter to work

Status
Not open for further replies.

gurfle

Member
Messages
37
Reaction score
0
Points
6
I suspect this post (http://x10hosting.com/forums/free-hosting/128651-still-trying-get-web-site-counter-work.html) got buried because of the huge effort in dealing with the latest conversion, so I am starting it up again, now that things seemed to have stabilzed a bit. Some partial, but indequate answers are found in this earlier post "cgi web page hit counter stopped working".

So here's the current situation:
It appears that /cgi-sys/Count.cgi is a valid reference on my web page, as in
Code:
<img src="/cgi-sys/Count.cgi?df=gurfle.dat|display=Counter|ft=3|md=5|  frgb=255;255;255|dd=D">
But as seen by going to http://dreyer.x10hosting.com/ what was a permission problem before the last server move, now has turned into a missing file (a pretty clear message will be seen right where counter normally goes at the bottom of the page):

/var/cpanel/counters/gurfle.dat

My problem: I do not know how, or if it is even possible for me to access this file location directly, and I don't know how to configure the cgi script to use another location. I do know that some 6 months or so ago this cgi script was working on x10hosting, but clearly all the server moves since then have changed that. Can anyone explain how to get this fixed? The cPanel File Manager does not appear to give me access to system folders such as /var under which this file is supposed to be located, so the suggestion made in response to my original post to use the cPanel File Manager did not make sense to me.

Maybe there are preferable ways to get web site counters working on x10hosting. If so, your thoughts on this too would be greatly appreciated.

Thanks a bunch in advance, Nick
 
Last edited:

Anna

I am just me
Staff member
Messages
11,743
Reaction score
579
Points
113
Hello,

Corey did take a look at the server config, this should now be sorted, and I do not see that message on your page, I do however see a broken image.

Do you have any idea what the permission problem was last time?
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
I took a look at this, the links for /cgi-sys/ were not working correctly but should now work.

However, I do not believe this script will work with how we have the web servers setup. Everytime a page loads it tries to write to a file locally on the server... the problem with this is each time you load your site it can load from a different server. I think you may have to use an external counter instead of the cPanel one.
 

gurfle

Member
Messages
37
Reaction score
0
Points
6
Hello,

Corey did take a look at the server config, this should now be sorted, and I do not see that message on your page, I do however see a broken image.?
Thanks for checking. Since I posted it appears that something has changed so that, as you say, there is now a broken image rather than the message. Probably as a result of someone (Corey?) working on the issue. It sounds from what Corey says that this cgi script approach will not work, however.

---------- Post added at 01:30 AM ---------- Previous post was at 01:09 AM ----------

I took a look at this, the links for /cgi-sys/ were not working correctly but should now work.
Actually, as Anna noted, the image now comes accross as broken rather than at least showing a decent counter box (allbeit displaying error message as opposed to counter) as it was before I posted, so what you did seems, unfortunately, to actually be a step backwards. I suspect that the problem was not in /cgi-sys/, since the script appeared to be running OK before your change, but rather to the fact that access to /var/cpanel/counters/ was restricted.

the problem with this is each time you load your site it can load from a different server...
Is there no way to have the script write to a file identified by a path realtive to the web page being loaded instead of to /var/cpanel/counters/ which I have no way of accessing, and as you indicate could be on a different server from one load to the next?
 
Last edited:

gurfle

Member
Messages
37
Reaction score
0
Points
6
The broken image problem has been solved. Instead the message in the counter box has changed from
"Could no write to counter file: /var/cpanel/counters/gurfle.dat"
to
"Counter datafile /var/cpanel/Counters/gurfler.dat must be created in cPanel first"
(as you should see if you go to http://dreyer.x10hosting.com/).

The solution would seem to be to have the script write to a file identified by a path relative to the web page being loaded instead of to /var/cpanel/counters/ which I have no way of accessing, I just can't figure out how to make that happen, especially since it is not clear to me why the folder /var/cpanel/counters/ is even being chosen by the cgi script.
 

gurfle

Member
Messages
37
Reaction score
0
Points
6
The broken image problem has been solved. Instead the message in the counter box has changed from
"Could not write to counter file: /var/cpanel/counters/gurfle.dat"
to
"Counter datafile /var/cpanel/Counters/gurfler.dat must be created in cPanel first"
(as you should see if you go to http://dreyer.x10hosting.com/).
Now message is back to

"Could not write to counter file: /var/cpanel/counters/gurfle.dat"

So file exists and cgi script must be working, but can't someone set the permission of this file somehow to allow it to be overwritten by anyone accessing my web page?
 
Status
Not open for further replies.
Top