设为首页 收藏本站
查看: 2640|回复: 0

[经验分享] Apache Awstats 安装配置系列 (4)之 Awstats 安装 配置

[复制链接]
累计签到:8 天
连续签到:1 天
发表于 2015-11-27 15:21:30 | 显示全部楼层 |阅读模式
  
awstats安装配置
  1. 下载awstats
http://www.awstats.org/
  2.解压缩到 D:\awstats-7.4
  3、初始化配置环境
进入 D:\awstats-7.4\tools
   执行 awstats_configure.pl文件
D:\awstats-7.4\tools>perl awstats_configure.pl
  4、输入 Apache Web目录
Apache Web server path ('none' to skip):
>D:\Apache22
  5、输入 httpd.conf的目录
  Now, enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
  
>D:\Apache22\conf\httpd.conf
  6、然后无需建立新conf,选N 按回车两次
  -----> Check and complete web server config file 'D:\Apache22\conf\httpd.conf'
  Add 'Alias /awstatsclasses "../wwwroot/classes/"'
  Add 'Alias /awstatscss "../wwwroot/css/"'
  Add 'Alias /awstatsicons "../wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "../wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.
  -----> Update model config file '..\wwwroot\cgi-bin\awstats.model.conf'
  File awstats.model.conf updated.
  -----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ?n
  7、在 httpd.conf自动增加了以下内容:
  
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses &quot;../wwwroot/classes/&quot;
Alias /awstatscss &quot;../wwwroot/css/&quot;
Alias /awstatsicons &quot;../wwwroot/icon/&quot;
ScriptAlias /awstats/ &quot;../wwwroot/cgi-bin/&quot;
  #
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory &quot;../wwwroot&quot;>
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
  8、修改D:\awstats-7.4\wwwroot\cgi-bin中的awstats.pl
将#!/usr/bin/perl
改为
#!D:/Perl/bin/perl.exe
  9、D:\awstats-7.4\wwwroot\cgi-bin中复制awstats.model.conf更改为awstats.www.dzh.com.conf
  LogType=W
Lang=&quot;auto&quot;更新为 Lang=&quot;cn&quot;
SiteDomain=&quot;www.dzh.com&quot;
AllowToUpdateStatsFromBrowser=0更为AllowToUpdateStatsFromBrowser=1
  10、更改apache的httpd.conf配置文件
D:\Apache22\conf\httpd.conf
将 CustomLog &quot;logs/access.log&quot; common
更改为
CustomLog &quot;|bin/rotatelogs.exe D:/Apache22/logs/access-%y%m%d.log 86400 480&quot; combined
  D:\Apache22\conf\extra\httpd-vhosts.conf
将 CustomLog &quot;logs/access.log&quot; common
更改为
CustomLog &quot;|bin/rotatelogs.exe D:/Apache22/logs/access-%y%m%d.log 86400 480&quot; combined
  11、配置完成,重启apache
  输入http://127.0.0.1:80/awstats/awstats.pl?config=www.dzh.com
提示
Forbidden
  You don't have permission to access /awstats/awstats.pl on this server.
12 、更改httpd.conf
<Directory &quot;../wwwroot&quot;>
   
Options None
   
AllowOverride None

Order allow,deny
  
Allow from all
  </Directory>
  
  更改为
<Directory &quot;/awstats-7.4/wwwroot&quot;>
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
  
Alias /awstatsclasses &quot;../wwwroot/classes/&quot;
Alias /awstatscss &quot;../wwwroot/css/&quot;
Alias /awstatsicons &quot;../wwwroot/icon/&quot;
ScriptAlias /awstats/ &quot;../wwwroot/cgi-bin/&quot;
更改为
  Alias /awstatsclasses &quot;/awstats-7.4/wwwroot/classes/&quot;
Alias /awstatscss &quot;/awstats-7.4/wwwroot/css/&quot;
Alias /awstatsicons &quot;/awstats-7.4/wwwroot/icon/&quot;
ScriptAlias /awstats/ &quot;/awstats-7.4/wwwroot/cgi-bin/&quot;
  13、重启apache, OK
http://127.0.0.1/awstats/awstats.pl?config=www.dzh.com
显示

统计网站:
www.dzh.com
  摘要
按参观时间:
按月历史统计
按日期统计
按星期
每小时浏览次数
按参观者:
国家或地区
  14、http://127.0.0.100/awstats/awstats.pl?config=www.dzh.com 也ok
  15、安全设置httpd.conf中输入更改
<Directory &quot;/awstats-7.4/wwwroot&quot;>
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
   
    AuthType Basic
    AuthName &quot;duanzhihua&quot;
    AuthUserFile C:/AWStats/wwwroot/cgi-bin/.passwd
    Require valid-user require
  
</Directory>
  16、进入apache,D:\Apache22\bin
执行htpasswd.exe生成用户名密码
  htpasswd.exe -c D:/awstats-7.4/wwwroot/cgi-bin/.passwd duanzhihua
  输入密码
  D:\awstats-7.4\tools>cd D:\Apache22\bin
  D:\Apache22\bin>htpasswd.exe -c D:/awstats-7.4/wwwroot/cgi-bin/.passwd duanzhihu
a
New password: ******
Re-type new password: ******
  
17、在D:\awstats-7.4\wwwroot\cgi-bin多了一个密码文件 .passwd
  18、重启apache
  再次打开
http://127.0.0.1/awstats/awstats.pl?config=www.dzh.com
  输入用户名密码报错
Internal Server Error
  The server encountered an internal error or misconfiguration and was unable to complete your request.
  Please contact the server administrator, admin@example.com and inform them of the time the error occurred, and
  anything you might have done that may have caused the error.
  More information about this error may be available in the server error log.
  
检查日志
127.0.0.1 - duanzhihua [20/Sep/2015:21:51:19 &#43;0800] &quot;GET /awstats/awstats.pl?config=www.dzh.com HTTP/1.1&quot; 500
  537 &quot;-&quot; &quot;Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130
  Safari/537.36&quot;
  [Sun Sep 20 21:51:19 2015] [error] [client 127.0.0.1] (OS 3)系统找不到指定的路径。  : Could not open password
  file: C:/AWStats/wwwroot/cgi-bin/.passwd
  19.之前httpd。conf中的路径配错了
将AuthUserFile C:/AWStats/wwwroot/cgi-bin/.passwd
更改为AuthUserFile D:/AWStats/wwwroot/cgi-bin/.passwd
  20 重启
打开http://127.0.0.1/awstats/awstats.pl?config=www.dzh.com
  报错
[Sun Sep 20 21:58:28 2015] [error] [client 127.0.0.1] (OS 3)系统找不到指定的路径。  : Could not open password
  file: D:/AWStats/wwwroot/cgi-bin/.passwd

  21将
D:/AWStats/wwwroot/cgi-bin/.passwd
改为
D:\awstats-7.4\wwwroot\cgi-bin\.passwd
  21重启测试
  打开http://127.0.0.1/awstats/awstats.pl?config=www.dzh.com
  输入用户名密码
  一切OK
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-144200-1-1.html 上篇帖子: Apache Awstats 安装配置系列 (1) 下篇帖子: awstats简介
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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