|








| |
- My CGI scripts don't work. What's wrong?
- I get errors while compiling on SGI, what's the problem?
- Why does the counter show "888888" all the time?
- The counter does not compile on UnixWare with cc, why?
- The counter does not compile on Solaris with cc, why?
- I get an error message "Could not write to counter file:
x/y/sample.dat". What's the problem?
- What does it mean when you say "user running the web server"?
- The counter seems to display random number. What's the problem?
- I get an error message "Host foo.com is not authorized". What's
the problem?
- What's the format of the data file?
- How can I reset the counter?
- How this program handles remote execution?
- What's the maximum number of hits the counter can handle?
- I sent you so many mails, how come you never respond?
- How can I turn off "Reload Ignore" feature?
- Is there any way to compile the counter without running the configuration
scripts?
- Why do I have to add a line to the config file every time I add a new
virtual host?
- The counter does not seem to increment, what's going on?
- How to configure the counter on virtual servers?

1. My CGI scripts don't work. What's wrong?
Answer: Simply linking from your page to an executable program or script won't
cause it to be run by the server. There are two common arrangements: either files in
directories specially designated by the server administrator are executed as CGI scripts,
or files with a special extension (such as .cgi) are executed as CGI scripts.
These are just two possible ways your server might be configured. Many sites don't
allow users to run CGI scripts at all. Consult your web server's administrator.
Taken from WWW FAQ

2.I get errors while compiling on SGI, what's the problem?
Answer: In SGI you might get errors like:
: libCombine.a
: - Too many arguments
*** Error code 1 (bu21)
*** Error code 1 (bu21)
To make it work, in libs/combine/Makefile, remove the line
$(RANLIB) $@
Thanks to avarro@CENTRCN.UMontreal.CA (12/07/95)

3. Why does the counter show "888888" all the time?
Answer: The counter is running in strict mode (look at count.cfg file).
When the counter runs in strict mode, if the browser does not return the environment
variable HTTP_REFERER, the counter will display the image 888888 instead of
serving the counter. The environment variable HTTP_REFERER should contain the web page
running the counter. Some browsers does not return this variable in <img GET method.

4. The counter does not compile on UnixWare with cc, why?
Note for UnixWare 2: Before running the configure script, set and export the
environment variable CC to the string
cc -Xc
Thanks to Ed Horch, ebh@fpk.hp.com

5. The counter does not compile on Solaris with cc, why?
If you are using Sun's cc on Solaris, you may get errors about identifier
redeclaration. Remove the line #include <unistd.h> from count.h. Recompile.
You will get some errors about undefined variables. Look at /usr/include/unistd.h
and add those defines in count.h. recompile.

6. I get an error message "Could not write to counter
file: x/y/sample.dat". What's the problem?
Answer: That means the user running the web server can not write to the
datafile. The correct way to make it work is to change the owner of the datafile to the
user running the web server and give read/write permission to that user only. You can only
do that if you're the super user. If you are not super use, you have to give read/write
permission to world. In Unix, "chmod 666 file" will do that. But this will allow
anyone to edit or delete your datafile.

7. What does it mean when you say "user running the web
server"?
Answer: Web servers can be configured to run the CGI program as a unique user
and a group. In apache web server, the user and the
group is specified with the directive User and Group in httpd.conf file respectively. I
suggest create a unique user and group first. For the user, put a * in the password field
in passwd file and use /bin/true as its shell. This way this user will never be able to
login to the system. And all CGI programs should be owned by the user and
read/write/execute permission to be given to that user only. Most of all, make sure you
look at all the CGI programs in your system. CGI programs are always a security risk. But
if you configured your server to execute CGI programs as a unique non-privileged user, the
damage to your system will be minimal, in case security is compromised due to CGI
programs.

8. The counter seems to display random number. What's the
problem?
Answer: If you do not specify a datafile with df= parameter, the counter will
display a random number.

9. I get an error message "Host foo.com is not
authorized". What's the problem?
Answer: Find the file count.cfg. Edit it with your favorite text editor. Add the
hostname in the error message at block 5. If you do not have access to the file, you have
to ask the person who installed the counter.
If you are running a system with many virtual domains, you will probably want to list
your IP addresses with wildcards. This prevents you from having to add an entry every time
a new virtual domain is added. As of version 2.4, the referer host will be looked up in
DNS if the USE_DNS directive is defined during compilation. Look at the comments in file src/Makefile.in
for instruction.
For example, if you have the class C IP address of 192.160.166.[1-254], instead of
listing every virtual host in this domain you could add:
192.160.166.*
to your config file at block 5. Note that this feature will NOT work with versions
prior to Count 2.4.

10. What's the format of the data file?
Answer: The counter data file is a text file. The format of this file is:
digits:IP
Example:
5678765456723456787567876567856:131.349.3.10
The digits are the numeric ASCII characters and IP is the IP number of the last host
visited the page. However, if you compiled with the flag COUNT_RELOAD=
-DCOUNT_RELOAD=1 in src/Makefile, then the datfile will only have the digit
part.

11. How can I reset the counter?
Answer: To reset the counter, find the file specified with df= parameter, edit
it with your favorite text editor. If you do not have access to the datafile, your
sysadmin has to do it for you.

12. How this program handles remote execution?
Answer: If you do not know, in most cases any CGI program can be executed
remotely without visiting the page with a browser. For example, a CGI program x.cgi (say
it returns an in-lined image) in foo. com can be called from foobar.com as follows:
<img src="http://foo.com/cgi-bin/x.cgi">
That is, someone somewhere on the Internet can refer to your counter and increase the
hits and you will not have a clue. You will get the false impression of many people
visiting your page.
So how this program handles this? The counter program tries to get a environment
variable called HTTP_REFERER for remote referrer. It is necessary to check this variable
because when someone remotely refer to a CGI program to your machine, the variable
REMOTE_ADDR will be the address of your machine. So checking REMOTE_ADDR will not work.
Most of the modern browsers returns the env variable HTTP_REFERER. If the browser does not
return the variable, counter will be served anyway. But you are not lost totally here. If
you decided to ignore count for your host running httpd, the counter will be served but it
will not be increased. So, I suggest ignore count for your own host. Gen-conf program is
used for generating the configuration file.
Note this is a simple solution of a complex problem. Due to the architecture of the web
itself, a determined evil hacker can always circumvent it.

13. What's the maximum number of hits the counter can handle?
Answer: By default compile time option, it can handle digits up to 80 character
long. However, this can be easily increased by editing the MAX_DIGITS directive in
count.h. Now a pop quiz, if a site gets one million hits/day, in which year the
counter will overflow?

14. I sent you so many mails, how come you never respond?
Answer: I receive enormous number of mails. Please understand that no way I can
answer all of the mails I receive. If the problem can be solved by reading the
documentation, you won't hear from me, otherwise I try my best to respond. But often I
just have too much to do and mails pile up. If you do not hear from me in 3 days, please
send the mail again but please note, your question should not be "please tell me how
to install the program".

15. How can I turn off "Reload Ignore" feature?
Answer: Before running sh ./configure, edit the file src/Makefile.in
and uncomment the line #COUNT_RELOAD= -DCOUNT_RELOAD=1. That is, remove
the # from the beginning. Then run sh ./configure and follow the
steps of compiling normally. If you already ran configure, then edit the file src/Makefile
instead.

16. Is there any way to compile the counter without running
the configuration scripts?
Answer: You might have though about it if you'r running configuration scripts
each time a new version is available. It is always a good idea to run the configuration
scripts before compiling the counter. However, it may not be necessary all the time unless
something changes (which will be documented with the release). Compile and install the
counter normally as instructed in the section Steps to compile and
install. Then copy the file src/config.h to somewhere safe. Then when a new
update of the counter source code is available, after extracting the source, copy the
saved config.h to the src directory and run ./configure and
follow the normal steps of compiling. After compilation, test it out from command line.
When satisfied, copy the file src/Count.cgi to your cgi-bin directory.

17. Why do I have to add a line to the config file every time
I add a new virtual host?
Answer: It's a security feature, to prevent users on other systems from using
your host as a "counter server". For information on automatically recognising
new virtual hosts as they're added, see the answer to question 9. (Contributed by: Sean Reifschneider jafo@gateway.tummy.com)

18. The counter does not seem to increment, what's going on?
Answer: It's a feature in the new release. It will only increment, if the
visitor's IP and the one in the datafile (last visitor) differs. It's there to handle if
people press "Reload" button continuously. If you do not like it, you can turn
it off at compile time. Please read the answer the Question 15.

19. How to configure the counter on virtual servers?
Answer: After running Count-config normally, edit src/config.h
and change any references to directory paths in line 13,15, 16 and 17 to include the part
of the path your virtual server can see. For example, if the real path is /user/mysite/local/etc/httpd/cgi-bin,
while the virtual server might only access /usr/local/etc/httpd/cgi-bin.
(Contributed by: Jim Morrissey j.morrissey@videowaves.com.)

|