# ./Count-config //开始设定
……
◆ cgi-bin dierctory [/usr/local/etc/httpd/cgi-bin]:
/usr/local/apache/cgi-bin //Apache默认的cgi-bin的目录
……
◆ Base directory [/usr/local/etc/Counter]:
/usr/local/Counter // wwwcount安装的目录
You need to enter the directory of the configuration file.
◆ Config directory [/usr/local/Counter/conf]: //默认按回车键
You will create this file later by running the program “Gen_conf”.
◆ Name of the configuration file [count.cfg]: //默认按回车键
You need to enter the directory of the counter data file.
◆ Data directory [/usr/local/Counter/data]: //默认按回车键
You need to enter the directory of the Log file.
◆ Log directory [/usr/local/Counter/Log]: //默认按回车键
◆ Name of the log file [Count2.6.log]: //默认按回车键
You entered:
++++++++++++++++++++++++++++++
CgiBinDir=/usr/local/apache/cgi-bin
……
++++++++++++++++++++++++++++++
Everything looks ok [y|n]? y //确定以上设置没问题后就按y
5.接下来输入“./configure”命令,开始一些测试主机情况。
6.如果想要让计数器每点击一次就增加一个数的话,在Makefile文件中找到“Makefile #COUNT_RELOAD= -DCOUNT_RELOAD=1 ”这行(大约在33行),将注解“#”符号取消,保存后退出。
7.输入命令“make clean”,然后开始编译可执行文件。
8.接着使用“./Gen-conf”命令设置主机信息,过程如下:
……
Continue [y|n]? y //按下y确定
Enter your fully qualified domain name [no default]:
game1.com.cn //需要输入主机名与域名
◆ Enter your IP address [no default]: 221.7.128.164
◆ Does your host have any nickname [y|n]:
? y //如果主机有多个名称,那就按y,否则按n
◆ Enter your host's nickname (FQDN) [no default]:
www.game1.com.cn //如果上面按y,才会出现需要填另一个主机名
◆ Do you want to allow automatic file creation [y|n]
? n //通常不希望自动产生文件
◆ Do you want the program to run in strict mode [y|n]? y
◆ Do you want to ignore access hits from your own host [y|n]? y
//用户自己访问,如果想计入其内,就按y。
……
9.开始进行安装,过程如下:
# ./Count-install
Your configuration:
……
Continue [y|n]? y //查看上面的设置信息是否正确,正确的话就开始安装
◆ Do you know the user and group id of httpd' child process [y|n]:? y
◆ Enter user id of httpd's child process [no default]:? nobody
◆ Enter group id of httpd's child process [no default]:? nobody
//如果用户不清楚,可以在httpd.conf文件中查找相关的设置
到此,安装就完成了。
应用
要使用上面搭建的计数器也很简单,只要在网页文件中的任何地方加入下面代码,就可以显示出计数器图形了:
<img SRC=“http://www.game1.com.cn/cgi-bin/Count.cgi?dd=A&ft=0&sh=T&pad=Y&df=test.dat”>
其中test.dat文件放在/usr/local/Counter/data目录下,用户可以参照下面对这个文件进行一些操作:
#cd /usr/local/Counter/data #echo 1 > test.dat #chown nobody:nobody test.dat #chmod 644 test.dat
本文地址:http://com.8s8s.com/it/it23792.htm