shilang 发表于 2019-1-30 06:29:35

awstats配置

chown -R root:root /usr/local/awstats
chmod -R =rwX /usr/local/awstats
chmod +x /usr/local/awstats/tools/*.pl
chmod +x /usr/local/awstats/wwwroot/cgi-bin/*.pl


cd /usr/local/awstats/tools
./awstats_configure.pl




# vim /etc/awstats/awstats.nginx.conf
#LogFile="/var/log/httpd/mylog.log" ==>>LogFile="/path/to/you_website_log_path"




mkdir -p /var/lib/awstats
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=nginx




先生成存放awstats生成的静态文件的目录,我这里用的是/usr/local/nginx/awstats


mkdir /usr/local/nginx/awstats


/usr/local/awstats/tools/awstats_buildstaticpages.pl -update-config=nginx -lang=cn -dir=/usr/local/nginx/awstats


/usr/local/awstats/tools/awstats_buildstaticpages.pl -update-config=nginx -lang=cn -dir=/usr/local/awstats/wwwroot/awstats






Main HTML page is 'awstats.nginx.html'.




ln -s awstats.nginx.html index.html






server {
    listen       80;
    server_namelocalhost;
    root html;
    index index.html;


    location ~ ^/awstats/ {   # awstats静态页面目录
      root   /usr/local/nginx ;
      autoindex on; #可以目录浏览你的多个域名的目录用于分析
      indexindex.html;
      access_log off;
    }


    location ~ ^/icon/ {             # 图标目录
      root   /usr/local/awstats/wwwroot;
      indexindex.html;
      access_log off;
    }
}


ln -s /usr/local/awstats/wwwroot/icon/usr/local/awstats/wwwroot/awstatsicons
  




页: [1]
查看完整版本: awstats配置