如何在dreamhost安装awstats
一直都不太喜欢Analog,个人觉得awstats要来人性化很强大的多,参考了dreamhost给出的安装说明,算是比较成功地安装上了。
操作步骤如何,
下载:http://awstats.sourceforge.net/files/awstats-6.5.tar.gz 并上传到根目录(home/username下)。
上SSH解压,命令如下
-
tar xfzv awstats-6.5.tar.gz
重命名,目录如下
-
mv awstats-6.5 awstats
-
cd awstats
建立新目录data,命令
-
mkdir data
-
chmod -R 755 data
移动目录,把/home/yourusername/awstats/wwwroot/cgi-bin/ 到 /home/yourusername/awstats/,ssh命令我没成功,直接用ftp移动。
到相关网站目录下建statistics文件夹,命令
-
cd domain.com
-
mkdir statistics
移动文件夹
-
cp /home/yourusername/awstats/wwwroot/icon /home/yourusername/domainname.com/statistics/icon
-
cp /home/yourusername/awstats/wwwroot/css /home/yourusername/domainname.com/statistics/css
-
cp /home/yourusername/awstats/wwwroot/js /home/yourusername/domainname.com/statistics/js
以上步骤其实都可以在ftp里完成,如果操作不成功可以尝试在FTP。
配置
找到awstats.model.conf,一般在awstats/cgi-bin/目录下,重命名为awstats.example.com.conf
-
cp awstats.model.conf awstats.example.com.conf
编辑这个文件,建议在本机用编辑器编辑,推荐的vi,我还没搞懂。
在最末尾加上
-
LogFile="/home/yourusername/logs/example.com/http/access.log.0"
-
SiteDomain="example.com"
-
HostAliases="www.example.com"
-
DNSLookup=0
-
DirData="/home/yourusername/awstats/data/"
-
DirIcons="icon"
-
SaveDatabaseFilesWithPermissionsForEveryone=0
-
DefaultFile="index.php index.html"
查看所有的pl文件属性是否设置为755了,否则不能运行
-
ls -o
看看程序是否正常工作
-
perl /home/yourusername/awstats/tools/awstats_buildstaticpages.pl -config=example.com -update \
-
-awstatsprog=/home/yourusername/awstats/awstats.pl -dir=/home/yourusername/example.com/statistics/
查看下网站statistics目录下是否有统计文件生成。
然后需要设置一个cron让程序自动运行,这个步骤我还操作不太熟练,不知道配置是否正确了,命令如下
-
crontab -e
Ctrl+R 写入以下代码
-
0 3 * * * perl /home/yourusername/awstats/tools/awstats_buildstaticpages.pl -config=example.com -update
-
-awstatsprog=/home/yourusername/awstats/awstats.pl -dir=/home/yourusername/example.com/statistics/
Ctrl+O 写入,Ctrl+X退出。
注:所有代码必须在一行。
同时可以可以到dreamhost的后台给statistics加上查看密码。
车东也有一篇关于awstats安装的文章,可以作为参考。
Technorati Tags: awstats
4月 15th, 2006 at 12:00 下午
下载:http://awstats.sourceforge.net/files/awstats-6.5.tar.gz 并上传到根目录(home/username下)。
–
下次在Dreamhost上不用上传,可以直接SSH后使用下载,飞快的:)
wget http://awstats.sourceforge.net/files/awstats-6.5.tar.gz
4月 15th, 2006 at 12:06 下午
试了,提示没有权限写入
解压的时候也有问题,必须先建好文件夹,属性还必须是777,否则也无法写入。