LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 933|回复: 0

Gentoo 安装AWStats

[复制链接]
发表于 2006-9-18 21:31:26 | 显示全部楼层 |阅读模式
Step 1. Download and Extract AWStats

    Download AWStats

    Extract the archive to the web directory on your system,标准的解压目录是:/usr/local/awstats

emerge awstats
Step 2. Config AWStats

    到/path/to/awstats/tools/执行:perl awstats_configure.pl。
    then
    1). Verify the LogFile value.  It should be the full path of your server log file (You can also use a relative path from your awstats.pl directory, but a full path avoids errors).

    2). Verify the LogType value.  It should be "W" for analyzing web log files.

    3). Check if LogFormat is set to "1" (for "NCSA apache combined/ELF/XLF log format") or use a custom log format if you don't use the combined log format.

    4). Set the SiteDomain parameter to the main domain name or the intranet web server name used to reach the web site to analyze (Example: www.mysite.com). If you have several possible names for same site, use the main domain name and add the others to the list in the HostAlias parameter.

    You can also change other parameters if you want. The full list is described in Configurations/Directives options page.

Step 3. Config LightTPD

Fire up lighttpd.conf in your favorite editor. Make sure that mod_cgi is in your modules configuration.


server.modules = ( "mod_rewrite", "mod_fastcgi", "mod_status", "mod_cgi", "mod_accesslog" )



Add a separate host entry for your AWStats instance.
$HTTP["host"] =~ "awstats.YOURDOMAINNAMEHERE" {
cgi.assign = (
".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl"
)
server.document-root = "/YOUR_PATH_TO/awstats/wwwroot/"
}


and then Restart Lighttpd and point your browser to:

http://awstats.YOURDOMAINNAMEHERE/cgi-bin/awstats.pl

or

http://awstats.YOURDOMAINNAMEHER ... =YOURDOMAINNAMEHERE

you also can use:


cgi.assign = (
".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl"
)
alias.url = (
"/awstats/" => "/YOUR_PATH_TO/awstats/wwwroot/"
)


so you can use

http://YOURDOMAINNAMEHERE/awstats/cgi-bin/awstats.pl

or

http://YOURDOMAINNAMEHERE/awstat ... =YOURDOMAINNAMEHERE

Step 5.Auto run AWStats

you can use Crontab to auto run AWStats using these command

perl awstats.pl -update -config=YOURDOMAINHERE

or

perl awstats.pl -config=mysite -output -staticlinks > awstats.mysite.html

注意:
如果出现/var/lib/awstats/不存在或没写权限的问题,自己创建该目录,更改写权限。

如果出现Forbiden的错误,更改/var/lib/awstats/权限还不行外,再更改/usr/local/awstats的所有者或权限。

ps:

http://awstats.sourceforge.net/docs/awstats_setup.html

http://www.benr75.com/pages/lighttpd_awstats_tutorial

更改显示的语言

找到Lang="auto"行把auto改为你需要的语言如en或cn
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表