• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >windows > 使用awstats分析Web日志及http访问控制

使用awstats分析Web日志及http访问控制

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含awstats,awstats中文,awstats下载,awstats官网,awstats安装等服务器相关知识,网友希望可以进行参考

1.解压并释放awstats软件包,执行目录中的awstats_configure.pl脚本进行安装

[root@test src]# tar zxvf awstats-7.1.tar.gz -C /usr/local/

[root@test src]# mv /usr/local/awstats-7.1/ /usr/local/awstats

[root@test src]# cd /usr/local/awstats/tools/

[root@test tools]# ./awstats_configure.pl


1)选择“y”,将httpd服务的日志记录格式改为“combined”,以便记录更多详细信息。

-----> Check and complete web server config file '/usr/local/apache2/conf/httpd.conf'

Warning: You Apache config file contains directives to write 'common' log files

This means that some features can't work (os, browsers and keywords detection).

Do you want me to setup Apache to write 'combined' log files [y/N] ? y

2)选择“y”创建新的配置文件

-----> 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] ? y

3)定义日志分析的目标网站名称如:www.benet.com)

-----> Define config file name to create

What is the name of your web site or profile analysis ?

Example: www.mysite.com

Example: demo

Your web site, virtual server or profile name:

> www.sn.com

4)定义awstats配置文件的存放目录默认为“/etc/awstats”)

-----> Define config file path

In which directory do you plan to store your config file(s) ?

Default: /etc/awstats

Directory path to store config file(s) (Enter for default):

>

5)添加cron计划任务安装脚本无法自动添加,提示用户需手动添加,按回国键继续)。

-----> Add update process inside a scheduler

Sorry, configure.pl does not support automatic add to cron yet.

You can do it manually by adding the following command to your cron:

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sn.com

Or if you have several config files and prefer having only one command:

/usr/local/awstats/tools/awstats_updateall.pl now

Press ENTER to continue...

6)按回车键退出安装脚本

A SIMPLE config file has been created: /etc/awstats/awstats.www.sn.com.conf

You should have a look inside to check and change manually main parameters.

You can then manually update your statistics for 'www.sn.com' with command:

> perl awstats.pl -update -config=www.sn.com

You can also read your statistics for 'www.sn.com' with URL:

> http://localhost/awstats/awstats.pl?config=www.sn.com


Press ENTER to finish...


2.修改awstats.www.benet.conf配置文件

[root@test conf]# vi /etc/awstats/awstats.www.sn.com.conf

LogFile="/usr/local/apache2/logs/sn.access.log"


3.创建数据库存放目录,并更新数据库

[root@test conf]# mkdir /var/lib/awstats

[root@test conf]# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update-config=

www.sn.com


4.设置cron计划任务,以便定时运行日志分析程序

[root@test conf]# crontab -e

* */5 * * * perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sn.com

[root@test logs]# service crond start

[root@test logs]# chkconfig --level 35 crond on


5.访问网址:http://www.sn.com/awstats/awstats.pl?config=www.sn.com

6.访问控制:基于用户的访问控制

(1)在httpd.conf里添加如下行

<Directory "/usr/local/awstats/wwwroot">

......

AuthName "AWSTATS"

AuthType Basic

AuthUserFile /usr/local/awstats/wwwroot/.htpasswd

require valid-user

</Directory>

(2)用htpasswd命令创建用户帐户“awuser”,并保存为.htpasswd文件,-c 表示新建谁文件,当向已有的认证文件中添加账号时可以省略“-c”选项。

[root@test bin]# cd /usr/local/apache2/bin/

[root@test bin]# ./htpasswd -c /usr/local/awstats/wwwroot/.htpasswd awuser

New password:

Re-type new password:

7.基于客户端地址的访问控制

Order allow,deny:先允许后拒绝,默认拒绝所有没有被明确允许的客户端地址。

Order deny,allow:先拒绝后允许,默认允许所有没有被明确拒绝的客户端地址。

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 使用awstats分析Web日志及http访问控制
  • 部署awstats分析系统

相关文章

  • centos6.4下DRBD 安装配置----超详细
  • 企业里实现代码自动部署、回滚的解决方案——Caphub
  • Hyper-V之VDI基础架构
  • Windows 2003:提高FSO的安全性
  • Windows Server 2003 iis配置php支持图文教程
  • 融合式架构--数据中心兴起的新星
  • Windows 2003与2008远程连接服务器设置图解
  • 让apache/iis服务器支持wap站点方法
  • cut、tr、wc、sort4
  • UAC窗体应用程序默认配置信息读写的问题

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 搭建基于Corosync+Pacemaker+NFS的高可用Web集群
    • Debian软Raid安装笔记
    • windows2003中带$符号的用户无法删除
    • ansible简单使用
    • iis 您未被授权查看该页
    • 搭建基于Heartbeat v2+NFS的高可用Web集群
    • Linux文件目录结构2
    • VM虚拟机提示operating system not found的解决方法
    • win2003 服务错误 在系统启动时至少有一个服务或驱动程序产生错误
    • Win2003哪里下载

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有