# 版權宣告: 1999 Copyright OLS3 All rights reserved.

# 作者: OLS3 (臥龍小三)
# 本講義僅供台南縣 87 學年度網路管理進階研習班上課之用.
# 學員可保存一份自用, 供日後網管時參考備查.
# 作者保有一切形式的著作權.
# 欲作其它用途者, 需經作者授權同意.
# 未經作者授權同意之前, 請勿轉載刊登.

計數器架設法

1. 取得 wwwcounter 程式:

可 ftp 至 www.tnc.edu.tw 中, 抓取 wwwcount-2.4-1.i386.rpm

2. 安裝:

以 root 權限, 下 rpm -ivh wwwcount-2.4-1.i386.rpm (或 rpm -ivh wwwcount*)

此時, wwwcounter 便已安裝完成. 相關檔案所置目錄如下:

設定檔在 /etc/wwwcounter.conf

資料檔在 /var/lib/wwwcount/data (所謂的資料檔, 就是用來儲存計數值的檔案)

3. 設定:

   在 /var/lib/wwwcount/data 中下:

   touch jmjh.dat (開啟一個新檔)

   chown nobody:nobody jmjh.dat (改變擁有人的身份為 nobody)

   chmod 644 jmjh.dat ( 即 rw-r--r-- , 此時, nobody 擁有寫入的權限 )

以下是 /etc/wwwcounter.conf 這個設定檔的內容:

#######
# configuratin file for Count 2.4
# Automatically generated from user input by the script Gen-conf
# Created on: Tue Oct 21 17:43:28 EDT 1997
# Edit by hand, if you need to add something
##############################################
####
# BLOCK 1 : 用來設定, 是否自動開啟儲存計數值的資料檔
# Allow automatic datafile creation or not
# it's a required block. 1 means allow, 0 means do not allow.
####
{
0
}
###
# BLOCK 2
# run the program in strict mode or not.
# it's a required block. 1 means strict, 0 means not strict.
###
{
1
}
####
# BLOCK 3
# Allow to use RGB color database. 1 means allow, 0 means don't.
# convenient to use because colorname e.g., red, gold etc can
# be used instead of rgb components of the color, however it's
# very inefficient to lookup.
####
{
1
}
####
# BLOCK 4
# Ignore count block, you might want to ignore the local sites.
# If you do not want to ignore any hosts from
# counting, just put { on one line and } on the next line but make sure
# the braces exist!
# It's a required block.
##
# netmasks can be used to ignore a entire network or a specific
# range of hosts in the network. Read the counter documentation to
# know about netmasks. Wild carding can be used.
# one item per line.
#131.249.*
####
{
}
####
# BLOCK 5 : 用來設定那些站台的網頁才有計數器的使用權, 
# 只要將貴校主機的 IP 及 網域名稱加入即可!
# Auth block
# All possible names and IP addresses by which your host can be referred.
# These hosts can access the counter remotely or locally. Host running
# the http server must exist here. Wild card can be used.
# one item per line.
## 在這裡加進您的主機的 IP 及 host name.
{
www.tnc.edu.tw
163.26.200.3
}


4. 掛上計數器的方法:

掛上計數器, 必須在網頁中使用 img 的 html 語法.

如 <img src="http://貴校網址/cgi-bin/Count.cgi?ft=2&df=資料檔名">

ft=2 是指使用第二種字型

df=ols3.dat 是指使用 ols3.dat 當作計數值的儲存檔

例如:

<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=2&frgb=111111&df=ols3.dat&comma=T">

詳細的語法, 請參考原始站台 http://www.fccc.edu/users/muquit/Count.html 的說明.

這個計數器也可以當作時鐘來用, 例如以下這個語法:

<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=2&frgb=000000&display=clock&cache=F&expires=0">

效果如右:

以下是引述自原始站台的範例:

 

Example page for Count 2.5

Generated by the program testcount-sh

For NT and other platforms, replace Count.cgi with Count.exe. In the examples, few number of digits are used for brevity, by default, the counter can handle 80 digit long number (10^80)-1, which is a very large number, that is if data is not edited by hand, it is impossible to overflow the counter. These tests use count_reload=Yes, so you will see consecutive hits are incremented. Note: these examples do not cover all the capabilities of the counter. Please read the Counter documentation for details.

simple, no frame, digit style A (default)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&ft=0">
df=sample.dat&ft=0

frame with default frame-color and thickness is 4 (specified)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&ft=4">
df=sample.dat&ft=4

A hidden counter is here
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&sh=F">
df=sample.dat&sh=F

Bangla digits
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=0&df=sample.dat&dd=bang&comma=T">
ft=0&df=sample.dat&dd=bang&comma=T

show the counter version
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=version">
display=version

countdown,Year 2000 implied from web server time
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=countdown&ft=0&dd=cd&negate=T">
display=countdown&ft=0&dd=cd&negate=T

countdown,Year 2000,just show the days only
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=countdown&sdhms=F">
display=countdown&sdhms=F

countdown from GMT to Year 2000
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=countdown&timezone=GMT+0000">
display=countdown&timezone=GMT+0000

countdown to Year 2000, show the from date(sfd) below
prgb (pen RGB) can be used to change the sfd color
<img src="http://163.26.167.1/cgi-bin/Count.cgi?cdt=2000;1;1;0;0;0&sfd=T&prgb=0000ff&dd=cd&ft=2&frgb=000000">
cdt=2000;1;1;0;0;0&sfd=T&prgb=0000ff&dd=cd&ft=2&frgb=000000

countdown from New York to Year 2000
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=countdown&dd=cdr&timezone=GMT-0500&sfd=T&ft=4">
display=countdown&dd=cdr&timezone=GMT-0500&sfd=T&ft=4

countdown to a specific date ,say 8 AM, Feb 1 2000
<img src="http://163.26.167.1/cgi-bin/Count.cgi?cdt=2000;2;1;8;0;0&sfd=T&dd=cdd&ft=2">
cdt=2000;2;1;8;0;0&sfd=T&dd=cdd&ft=2

countdown to past Feb 1 1998 8 AM
<img src="http://163.26.167.1/cgi-bin/Count.cgi?cdt=1998;2;1;8;0;0&sfd=T&dd=cd&ft=2&negate=T">
cdt=1998;2;1;8;0;0&sfd=T&dd=cd&ft=2&negate=T

difference between Jul 16,1999 10 PM and Jul 17 1999 10AM
<img src="http://163.26.167.1/cgi-bin/Count.cgi?cdf=1999;7;16;22;0;0&cdt=1999;7;17;10;0;0">
cdf=1999;7;16;22;0;0&cdt=1999;7;17;10;0;0

countdown to year 2000 from Jul 17, 1999
<img src="http://163.26.167.1/cgi-bin/Count.cgi?cdf=1999;7;17;0;0;0">
cdf=1999;7;17;0;0;0

No datafile specified with df ,therefore, random digits will be displayed
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=0">
ft=0

digit style B
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&dd=B">
df=sample.dat&dd=B

digit style C,display comma if more than 3 digits
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&dd=C&comma=T">
df=sample.dat&dd=C&comma=T

digit style D
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=3&df=sample.dat&dd=D">
ft=3&df=sample.dat&dd=D

digit style E, make white transparent
<img src="http://163.26.167.1/cgi-bin/Count.cgi?trgb=ffffff&df=sample.dat&dd=E">
trgb=ffffff&df=sample.dat&dd=E

red frame with default thickness
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&frgb=ff0000">
df=sample.dat&frgb=ff0000

Hidden counter
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&sh=F">
df=sample.dat&sh=F

literal string with comma
<img src="http://163.26.167.1/cgi-bin/Count.cgi?lit=94032048040320&comma=T&dd=D&ft=2">
lit=94032048040320&comma=T&dd=D&ft=2

frame color can be Red,Green and Blue triplets
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=4&lit=0123456&frgb=0;0;255">
ft=4&lit=0123456&frgb=0;0;255

frame color can be hex as well,using blue here
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=4&lit=0123456&frgb=0000ff">
ft=4&lit=0123456&frgb=0000ff

frame color can be a name as well
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=4&lit=0123456&frgb=Gray">
ft=4&lit=0123456&frgb=Gray

change green digit-color to default pen color
<img src="http://163.26.167.1/cgi-bin/Count.cgi?lit=1234567&chcolor=T">
lit=1234567&chcolor=T

change green digit-color to yellow
<img src="http://163.26.167.1/cgi-bin/Count.cgi?lit=1234567&srgb=00ff00&prgb=ffff00">
lit=1234567&srgb=00ff00&prgb=ffff00

show time (12 hr format)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=clock">
display=clock

show time (12 hr format) don't pad hr with zero
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=clock&pad=F">
display=clock&pad=F

show time (24 hr format)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=clock&tformat=24">
display=clock&tformat=24

show GMT Time
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=clock&timezone=GMT+0000">
display=clock&timezone=GMT+0000

show time of Dhaka (GMT+0600),Bangladesh
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=clock&timezone=GMT+0600">
display=clock&timezone=GMT+0600

show date (MM-DD-YY)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=date&dd=cdr">
display=date&dd=cdr

show date (DD-MM-YY)
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=date&dformat=ddmmyy">
display=date&dformat=ddmmyy

show date (DD-MM-YYYY) use YYYY to show full year
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=date&fy=T&dd=cd&dformat=ddmmyyyy">
display=date&fy=T&dd=cd&dformat=ddmmyyyy

show date (DD-MM-YY) use fy to show full year
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=date&fy=T&dd=cd&dformat=ddmmyy">
display=date&fy=T&dd=cd&dformat=ddmmyy

make the green color transparent,no frame
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&trgb=00ff00">
df=sample.dat&trgb=00ff00

make the black color transparent
<img src="http://163.26.167.1/cgi-bin/Count.cgi?df=sample.dat&trgb=000000">
df=sample.dat&trgb=000000

make the black color transparent,change green color to a shade of gray
<img src="http://163.26.167.1/cgi-bin/Count.cgi?srgb=00ff00&prgb=101010&df=sample.dat&trgb=000000">
srgb=00ff00&prgb=101010&df=sample.dat&trgb=000000

display Lenna's image, also increment counter silently
<img src="http://163.26.167.1/cgi-bin/Count.cgi?display=image&dd=D&image=lenna.gif&df=sample.dat&incr=T&frgb=8B6508&ft=20">
display=image&dd=D&image=lenna.gif&df=sample.dat&incr=T&frgb=8B6508&ft=20

composite counter at the bottom center of the image, make white transparent
<img src="http://163.26.167.1/cgi-bin/Count.cgi?image=foo.gif&dd=E&comma=T&df=sample.dat&align=bottomcenter&tr=T&trgb=ffffff">
image=foo.gif&dd=E&comma=T&df=sample.dat&align=bottomcenter&tr=T&trgb=ffffff

composite counter at the top center of the image, offset is 5 pixels from top
<img src="http://163.26.167.1/cgi-bin/Count.cgi?image=yeehaw.gif&dd=A&df=sample.dat&comma=T&align=topcenter&offset=5&ft=4">
image=yeehaw.gif&dd=A&df=sample.dat&comma=T&align=topcenter&offset=5&ft=4

composite counter at the bottom center of the image,make black transparent
<img src="http://163.26.167.1/cgi-bin/Count.cgi?image=peng.gif&dd=A&df=sample.dat&comma=T&align=bottomcenter&offset=40&trgb=000000&ft=0">
image=peng.gif&dd=A&df=sample.dat&comma=T&align=bottomcenter&offset=40&trgb=000000&ft=0

rotate 270 degrees. Note, degrees are implied here
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=0&df=sample.dat&rotate=T&dd=D">
ft=0&df=sample.dat&rotate=T&dd=D

rotate 180 degrees
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=0&df=sample.dat&dd=D&degrees=180">
ft=0&df=sample.dat&dd=D&degrees=180

rotate 90 degrees
<img src="http://163.26.167.1/cgi-bin/Count.cgi?ft=0&df=sample.dat&degrees=90&dd=D&prgb=ffff00">
ft=0&df=sample.dat&degrees=90&dd=D&prgb=ffff00

Muhammad A Muquit
Generated on: Sat Jul 17 21:49:28 EDT 1999 by testcount-sh (1.2)
(Linux madina 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i686 unknown)