Archive for August, 2007

OS installing …

先装windows

windows xp sp2 (番茄花园3.1)

965motherboard 驱动
nv driver 93.71
xfi driver 31.01

kis 6.0.2.621 cn

Firefox 2.0.0.5 cn

google pinyin 1.0.20

winrar 3.70 cn
7z 4.42 cn

daemontool 4.0.91 en

BitComet 0.91 cn

Saitek Evo driver sst
Logitech G5 SetPoint

Nero 7.7.5.1
PQmagic 8.0

foobar 2k 0943 cn
kmp 2.9.3 cn
Real Alternative 1.52

然后开始无休止的文件整理 ……….

Comments

周末重装OS

XP经历了几个月的裸奔,几个月的只有杀毒软件没有防火墙,今日终于出现靡靡之相:explorer频繁重启,IE7乱弹广告。
剃发明志,弃医从文。重装OS庆祝桌子椅子,顺便把声场调整调整。
也能把这段时间装的一堆软件游戏彻底忘掉,playstation PC转变成workstation PC。
还有…… ubuntu、solaris、federo

Comments

时区设置

忽然想起来DH的server都是在US的,系统时间岂不是和CN不同。
ssh上去一看,果然错误,系统用的是PDT
然后改成PRC,

$vi ~/.bash_profile

末尾增加一行

export TZ=PRC

这样以后登录就都是GMT+8了

查了wordpress,在Options有blog运行时区的设置,很早以前就设置了GMT+8,这个和系统时区无关的。
看了下这几天的文字的日期,也都正确。

Gallery2的时间只精确到day,倒省心,反正照片的拍摄信息里的时间更为有用。

phpBB的控制台也有时区选择,之前设置过,也没出错。

倒是crontab之类和时间密切相关的程序需要自己大脑进行时区转换了。
昨天设置的0 9 * * * , 本想每天上午可以刷新,可是现在还没执行到呢 :(

难道以后装软件都要留心这个问题不成?应该有彻底些的办法。寻觅中……

Comments

[DreamH 3]网站访问统计awstats

dreamhost将logs目录固化在用户根目录下了, 分域名存储,目录结构如下

logs
|– fanlix.com
| |– http -> http.5xxxxx9
| `– http.5xxxxx9
| |– access.log
| |– access.log.0 -> access.log.2007-07-31
| |– access.log.2007-07-28.gz
| |– access.log.2007-07-29.gz
| |– access.log.2007-07-30
| |– access.log.2007-07-31
| |– analog
| | |– fanlix.com.2007-07.cache
| | |– fanlix.com.2007-07.cache.yesterday
| | |– fanlix.com.daily.conf
| | |– fanlix.com.longterm.cache
| | |– fanlix.com.longterm.cache.yesterday
| | |– fanlix.com.longterm.conf
| | `– fanlix.com.monthly.conf
| |– analog_success.txt
| |– error.log
| |– error.log.0 -> error.log.2007-07-31
| |– error.log.2007-07-28.gz
| |– error.log.2007-07-29.gz
| |– error.log.2007-07-30
| |– error.log.2007-07-31
| |– hits
| | |– bandwidth.20070728
| | |– bandwidth.20070729
| | |– bandwidth.20070730
| | |– hits.20070730
| | `– ref.20070730
| `– html
| |– daily
| |– daily.html -> /home/fanlix/logs/fanlix.com/http.5xxxxx9/html/inactive_report.html
| |– inactive_report.html
| |– index.html -> /home/fanlix/logs/fanlix.com/http.5xxxxx9/html/monthly/2007-07/index.html
| |– longterm
| | |– code.png
| | |– index.html
| | `– size.png
| |– longterm.html -> /home/fanlix/logs/fanlix.com/http.5xxxxx9/html/longterm/index.html
| |– main.html
| |– monthly
| | `– 2007-07
| | |– browrep.png
| | |– browsum.png
| | `– type.png
| `– monthly.html -> /home/fanlix/logs/fanlix.com/http.5xxxxx9/html/monthly/2007-07/index.html

可见不只是apache日志那么简单,还有简单的统计分析。
可是google了一下也没找到访问的方式,DH自己的页面里也只是说道可以下载Funnel Web来自己进行数据统计,并没说这些文件的何去何从。

不论怎么统计,似乎不能比awstats再厉害了吧。
以前用过awstats,还曾经通过上面记录的一个可疑ip,一路反查出一个访问我blog的同学来。
Let’s yEsTerday onCe mOre.

首先到Panel -> Status -> Site Statistics 将logs的保存选择为恰当时效,比如360 Day (hoho~)
默认是保存3日,超过3日的会占用自己的空间,200G,随便用吧。
后面的edit点进去可以设置生成日志统计和邮件提醒的细节。
难怪刚才找不到logs目录的访问方式,原来那些统计文件是发邮件用到的。将logs目录开放是很危险的。

DH默认是没有装awstats的:

$ aptitude search awstats
p awstats – powerful and featureful web server log analyzer

自己动手:

$ wget ‘http://jaist.dl.sourceforge.net/sourceforge/awstats/awstats-6.7.tar.gz’
$ tar -zxvf awstats-6.7.tar.gz
$ mv awstats-6.7 ~/websoft/awstats

————–中间这个方法有些麻烦,可以跳过看下个分割线—————–
然后到panel设置访问路径
Domains -> Remap Sub-Dir
将 http://www.fanlix.com/awstats 映射到 /home/fanlix/websoft/awstats/wwwroot
(有句话提示映射到他人目录没有cgi执行权限, 也就是说可以映射了哦…. shell可是无法访问他人目录的)

cd cgi-bin/
cp awstats.model.conf awstats.fanlix.com.conf
vi awstats.fanlix.com.conf

1500行的配置文件,在结尾加上必要的配置即可:

LogFile=”/home/fanlix/logs/fanlix.com/http/access.log”
SiteDomain=”fanlix.com”
HostAliases=”www.fanlix.com”
DNSLookup=0
DirData=”/home/fanlix/websoft/awstats/awdata”
DirIcons=”icon”
SaveDatabaseFilesWithPermissionsForEveryone=0
DefaultFile=”index.php index.html”
LogFormat=”%host %other %other %time1 %methodurl %code %bytesd %refererquot %uaquot”

然后设置crontab 定时每天9点运行

0 9 * * * (/home/fanlix/websoft/awstats/wwwroot/cgi-bin/awstats.pl -config=fanlix.com -update 2>&1 >/dev/null)

别忘记把执行的cmd在shell里跑一下。输出如下:

Create/Update database for config “/home/fanlix/websoft/awstats/wwwroot/cgi-bin/awstats.fanlix.com.conf” by AWStats version 6.7 (build 1.892)
From data in log file “/home/fanlix/logs/fanlix.com/http/access.log”…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 233
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 233 new qualified records.

这时候应该可以用域名来访问这个统计页面了
怎么是 Index …… 改改改
怎么看不到图标 …. 改改改
怎么 ….. 不改了,太麻烦

———————–下面方法是最佳的—————————
以前的安装方法在dreamhost有些麻烦,参考了wiki的方法:
http://wiki.dreamhost.com/index.php/AWStats_Installation
1, 不使用dreamhost的subdir remap.
直接在域名根目录建立目录 awstats,作为awstats的dir目录
将wwwroot下的4个资源文件夹link 到这里

2,配制文件如上面的设置,无需改变

3,crontab 使用awstats自带的tool脚本

0 9 * * * ( /usr/bin/perl /home/fanlix/websoft/awstats/tools/awstats_buildstaticpages.pl -config=fanlix.com -update \
-awstatsprog=/home/fanlix/websoft/awstats/wwwroot/cgi-bin/awstats.pl -dir=/home/fanlix/fanlix.com/awstats 2>&1 >/dev/null )

这样会在fanlix.com/awstats/下面生成一系列静态页面

4,主html是awstats.fanlix.com.html,可以通过.htaccess或者直接link把它作为index,这样就能直接访问了
以前都是用cgi-bin目录的脚本加参数访问的,比如
http://www.fanlix.com/awstats/awstats.pl?config=www.fanlix.com
现在变成静态页面,方式好了很多。(除了不能动态调用脚本功能了)

现在终于可以看到访问统计了:http://www.fanlix.com/awstats/

目前比以前安装的结果还缺少2个功能: 访问控制、IP数据库。
控制到无所谓了,如此小的访问量笑话就笑吧;IP数据库倒是比较实用。

Comments (1)

« Previous Page « Previous Page Next entries »