建立Software目录,下载Awstats源码,然后解压。
?mkdir-p /data0/softwarecd/data0/softwarewgethttp://ncu.dl.sourceforge.net/project/awstats/AWStats/7.0/awstats-7.0.tar.gztarzxf awstats-7.0.tar.gz
检查Perl版本
?perl–version
执行 awstats-7.0/tools 目录中的 awstats_configure.pl 配置向导,创建统计。
?perl/data0/software/awstats-7.0/tools/awstats_configure.pl
因为用的是 Nginx,输入 none
?----->Check for webserver install Enterfull config file path of your Web server.Example:/etc/httpd/httpd.confExample:/usr/local/apache2/conf/httpd.confExample:c:\Program files\apache group\apache\conf\httpd.confConfigfile path ('none' toskip web server setup):#>none
输入y,创建一个新的配置文件
?Yourweb server config file(s) could not be found.Youwill need to setup your web server manually to declare AWStatsscriptas aCGI, if youwant to build reports dynamically.SeeAWStats setup documentation (file docs/index.html) ----->Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf' Fileawstats.model.conf updated. ----->Need to create a new configfile ?Doyou want me to build a new AWStatsconfig/profilefile(required if firstinstall) [y/N] ?#>y
输入要统计的域名,(以www.tele6.me为例)
?----->Define config file name to createWhatis thename of your web site or profile analysis ?Example:www.mysite.comExample:demoYourweb site, virtual serveror profile name:#>www.tele6.me
然后一路回车
?----->Define config file pathInwhich directory do youplan to store your config file(s) ?Default:/etc/awstatsDirectorypath to store config file(s) (Enter for default):#> ---->Add update process inside a schedulerSorry,configure.pl does not support automatic add to cron yet.Youcan do itmanually by adding the following command to your cron:/data0/software/awstats-7.0/wwwroot/cgi-bin/awstats.pl-update -config=www.tele6.me Orif youhave several config files and prefer having only one command:/data0/software/awstats-7.0/tools/awstats_updateall.plnowPressENTER to continue... ASIMPLE config file has been created: /etc/awstats/awstats.www.tele6.me.conf Youshould have a look inside to check and change manually main parameters.Youcan then manually update your statistics for 'www.tele6.me' withcommand:>perl awstats.pl -update -config=www.tele6.meYoucan also build static reportpages for 'www.tele6.me' withcommand:>perl awstats.pl -output=pagetype -config=www.tele6.me PressENTER to finish...
回车完成安装,然后修改awstats的配置文件:
?vi/etc/awstats/www.tele6.me.conf