1.安装perl,下载地址:
b.运行安装程序,安装到d:\perl,其余使用默认值,安装完成即可。
2.让Tomcat支持cgi.(只需要第一步)
解压到D:\jakarta-tomcat-5.5.7\webapps.
先把D:\jakarta-tomcat-5.5.7\webapps\awstats\WEB-INF\cgi-bin下的awstats.model.conf命名为common.conf,
接着建立新文件,awstats.localhost.conf内容参考车东的文件,
启动Tomcat,通过
就可以生成日志分析结果了。
为了保护日志分析,我在
D:\jakarta-tomcat-5.5.7\webapps\awstats\WEB-INF\web.xml里加上了下面一段
(来自D:\jakarta-tomcat-5.5.7\server\webapps\manager\web.xml)用来保护访问资源:
<!-- Define reference to the user database for looking up roles -->
<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>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Awstats status</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>lizongbo</role-name>
</security-role>
相关参考资源:
Trackback: http://tb.donews.net/TrackBack.aspx?PostId=280224