下载:

1.apache-tomcat-7.0.67

2.ActivePerl-5.22.1.2201-MSWin32-x86-64int-299574.msi

3.awstats-7.4.zip

修改Tomcat的server.xml:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".log" pattern="combined" fileDateFormat="yyyy-MM-dd"
resolveHosts="false"/>

创建awstats app

1. 在Tomcat的webapp目录下建立文件夹awstats

在META-INF 下新建context.xml文件

<Context reloadable="true" privileged="true">

</Context>

在WEB-INF 下新建 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>clientInputTimeout</param-name>
<param-value>100</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi-bin</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping> <resource-env-ref>
<description>
Link to the UserDatabase instance from which we request lists of
defined role names. Typically, this will be connected to the global
user database with a ResourceLink element in server.xml or the context
configuration file for the Manager web application.
</description>
<resource-env-ref-name>users</resource-env-ref-name>
<resource-env-ref-type>org.apache.catalina.UserDatabase</resource-env-ref-type>
</resource-env-ref>
<!-- Define a Security Constraint on this Application -->
<security-constraint>
<web-resource-collection>
<web-resource-name>awstats status</web-resource-name>
<url-pattern>/cgi-bin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>awstats</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Awstats status,username: awstats,password: awstats</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<description>
The role that is required to log in to the Manager Application
</description>
<role-name>awstats</role-name>
</security-role> <welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

复制cgi-bin到WEB-INF目录下

配置 awstats

1. 将 WEB-INF/cgi-bin目录下的awstats.model.conf文件改名为common.conf,新建文件awstats.localhost.conf,内容如下:

Include "common.conf"
LogFile="D:/tool/apache-tomcat-7.0.67/logs/localhost_access_log.%yyyy-%mm-%dd.log"
SiteDomain="localhost"
HostAliases="localhost 127.0.0.1"
DefaultFile="index.jsp"
#在cgi-bin建立data文件夹
DirData="data"
DirCgi="/cgi-bin"
DirIcons="/awstats/icon"
#允许在web页更新日志,默认为0(命令行更新)
AllowToUpdateStatsFromBrowser=1

访问地址http://localhost:8080/awstats/cgi-bin/awstats.pl?config=localhost可以看到awstats的统计界面。点击“立即更新”连接,可以更新统计信息

访问的时候需要 用户配置
<role rolename="awstats"/>
<user username="awstats" password="awstats" roles="awstats"/>

awstats + tomcat + windows的更多相关文章

  1. Nginx + Tomcat Windows下的负载均衡配置

     Nginx + Tomcat Windows下的负载均衡配置 一.为什么需要对Tomcat服务器做负载均衡?    Tomcat服务器作为一个Web服务器,其并发数在300-500之间,如果超过50 ...

  2. Tomcat Windows 系统下安装及注意事项

    1 获取Tomcat 安装包  http://tomcat.apache.org/ tar.gz 文件是Linux系统下的安装版本 exe文件是 Windows系统下的安装版本 zip 文件是Wind ...

  3. Tomcat(Windows)

    百度云:链接:http://pan.baidu.com/s/1pKYrf79    密码:56t0 官网下载网址:http://archive.apache.org/dist/tomcat/tomca ...

  4. Tomcat Windows 开机自启

    在命令提示符中,进入 tomcat 的 bin 目录,执行命令,注册服务 service.bat install 在"服务"中,将 tomcat 服务设为自动

  5. Tomcat Windows 内存设置

    双击 bin 目录下 tomcat8w.exe,在 java 标签内修改内存配置

  6. nginx安装配置+集群tomcat:Centos和windows环境

    版本:nginx-1.8.0.tar.gz 官网:http://nginx.org/en/download.html         版本:apache-tomcat-6.0.44.tar.gz  官 ...

  7. 【转】Tomcat版本是32位、64位问题

    转载地址:http://www.cnblogs.com/greensleeves/p/3168541.html 最近遇到一个Tomcat windows安装版本是32位还是64位问题.由于一系列原因, ...

  8. tomcat 新手上路

    前提:本机先安装好JDK,保证常规java环境已经具备 1.下载Tomcat 7.0现在官网上好象已经没有安装程序版了,只有免解压zip版本(现在最新的版本是7.0.42) 下载地址 http://t ...

  9. CentOS安装tomcat

    一.下载Tomcat 1..进入Tomcat官网:http://tomcat.apache.org/ 左侧选择相应的版本 点击Tomcat 6.0后 点击tar.gz下载apache-tomcat-6 ...

随机推荐

  1. LeetCode OJ 64. Minimum Path Sum

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which ...

  2. 小米2s刷机

    每次系统内存不足,卡的不行就恨不得马上换新手机,发现手机也没有什么大的毛病,也没有其他苛刻的要求. 换个新系统继续使用吧,除了屏幕小了一点,将就了吧.物尽其责,坚决抵制过度消费. 小米手机2s 16G ...

  3. MMS model

  4. javascript显式类型的转换

    显式类型转换目的:为了使代码变得清晰易读,而做显示类型的转换常使用的函数:Boolean(),String(),Number()或Object()如:Nunber(5) //5String(true) ...

  5. ASP.NET中的Excel操作(NPOI方式)

    代码准备: 一:实体准备 代码如下: /// <summary> /// 一个能添加到将要导出到指定行的实体类型规范 /// data:{int StartColIndex ? 0, in ...

  6. mysql备份并自动压缩命令

    #! /bin/bash mysqldump -uroot -p'password' databasename | gzip > /home/backup/database_`date +%Y% ...

  7. MFC下MCI的使用播放音乐

    最近研究了一下MFC下的音乐的播放,主要使用了MCI 1.需要包含的库文件 在链接资源里(link)添加库文件VFW32.lib winmm.lib 2.包含的头文件 #include <mms ...

  8. URL匹配与req参数解析

    通配URL*(可代表任何字符串) 例如: app.get('/test/*', function(req, res){ res.send(req.query.aa); }) '/test/*通配tes ...

  9. Python 修炼1

    2016年11月21日 Python基础修炼第一篇 1.Python是什么?有什么优缺点呢? python是一个高级编程语言. 优点:开发效率比较高,不但有php写网页的功能,还有写后台的功能 缺点: ...

  10. 学习笔记——迭代器模式Iterator

    迭代器模式,使用很多,但是很少实现.常用的集合都支持迭代器. 集合中的CreateIterator()可用于创建自己的迭代器,在里面通过调用迭代器的构造函数Iterator(Aggregate)来绑定 ...