Download:
1.apache-tomcat-7.0.67
2.activeperl-5.22.1.2201-mswin32-x86-64int-299574.msi
3.awstats-7.4.zip
To modify Tomcat's 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 "/>
Create Awstats App
1. Create a folder under Tomcat's WebApp directory Awstats
Create a new context.xml file under Meta-inf
<context reloadable= "true" privileged= "true" ></Context>
Create a new Web. XML under Web-inf
<?XML version= "1.0" encoding= "UTF-8"?><Web-appXmlns: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 ofdefined role names. Typically, this is connected to the Globaluser database with a resourcelink element in Server.xml or the CONTEXTCONFI Guration 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's required to log on 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>
Copy the Cgi-bin to the Web-inf directory
Configure Awstats
1. Rename the awstats.model.conf file in the Web-inf/cgi-bin directory to common.conf and create a new file awstats.localhost.conf with the following contents:
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 establishes data folder Dirdata= "Data" dircgi= "/ Cgi-bin " diricons="/awstats/icon " #允许在web页更新日志, default = 0 (command-line update) Allowtoupdatestatsfrombrowser=1
Access address Http://localhost:8080/awstats/cgi-bin/awstats.pl?config=localhost can see the Awstats statistics interface. Click the "Update Now" connection to update the statistics
User Configuration is required when accessing
<role rolename= "Awstats"/>
<user username= "Awstats" password= "Awstats" roles= "Awstats"/>
Awstats + tomcat + windows