<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=AWStats</id>
	<title>AWStats - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=AWStats"/>
	<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=AWStats&amp;action=history"/>
	<updated>2026-11-17T02:10:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=AWStats&amp;diff=7226&amp;oldid=prev</id>
		<title>Leo: Created page with &quot;AWStats is an open source Perl-based web application that generates web analytics from access logs.  == Running in Docker to parse Traefik access logs == Use the Docker image built by pabra at: https://github.com/pabra/docker_awstats  Create a &lt;code&gt;docker-compose.yml&lt;/code&gt; file and configure the AWSTATS_CONF_LOGFORMAT environment variable to match the Traefik access log syntax. {{Highlight | code = version: &quot;3&quot; services:   awstats:     build:       context: docker_awst...&quot;</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=AWStats&amp;diff=7226&amp;oldid=prev"/>
		<updated>2023-05-23T18:08:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;AWStats is an open source Perl-based web application that generates web analytics from access logs.  == Running in Docker to parse Traefik access logs == Use the Docker image built by pabra at: https://github.com/pabra/docker_awstats  Create a &amp;lt;code&amp;gt;docker-compose.yml&amp;lt;/code&amp;gt; file and configure the AWSTATS_CONF_LOGFORMAT environment variable to match the Traefik access log syntax. {{Highlight | code = version: &amp;quot;3&amp;quot; services:   awstats:     build:       context: docker_awst...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;AWStats is an open source Perl-based web application that generates web analytics from access logs.&lt;br /&gt;
&lt;br /&gt;
== Running in Docker to parse Traefik access logs ==&lt;br /&gt;
Use the Docker image built by pabra at: https://github.com/pabra/docker_awstats&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;docker-compose.yml&amp;lt;/code&amp;gt; file and configure the AWSTATS_CONF_LOGFORMAT environment variable to match the Traefik access log syntax.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = version: &amp;quot;3&amp;quot;&lt;br /&gt;
services:&lt;br /&gt;
  awstats:&lt;br /&gt;
    build:&lt;br /&gt;
      context: docker_awstats&lt;br /&gt;
      dockerfile: Dockerfile&lt;br /&gt;
    networks:&lt;br /&gt;
      - traefik&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /volumes/awstats:/var/lib/awstats&lt;br /&gt;
      - /var/log/traefik:/logs:ro&lt;br /&gt;
    environment:&lt;br /&gt;
      - &amp;quot;TZ=MST7MDT,M3.2.0,M11.1.0&amp;quot;&lt;br /&gt;
      - &amp;#039;AWSTATS_CONF_LOGFORMAT=%host %other %other %time1 %methodurl %code %bytesd %refererquot %uaquot&amp;#039;&lt;br /&gt;
      - &amp;#039;AWSTATS_CONF_SITEDOMAIN=&amp;quot;example.com&amp;quot;&amp;#039;&lt;br /&gt;
      - &amp;#039;AWSTATS_CONF_HOSTALIASES=&amp;quot;example.com&amp;quot;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    labels:&lt;br /&gt;
      - traefik.enable=true&lt;br /&gt;
      - traefik.docker.network=traefik&lt;br /&gt;
      - traefik.http.middlewares.awstats-https-redirect.redirectscheme.scheme=https&lt;br /&gt;
      # http&lt;br /&gt;
      - traefik.http.routers.awstats.entrypoints=http&lt;br /&gt;
      - &amp;#039;traefik.http.routers.awstats.rule=Host(`awstats.example.com`)&amp;#039;&lt;br /&gt;
      - traefik.http.routers.awstats.middlewares=awstats-https-redirect&lt;br /&gt;
      # https&lt;br /&gt;
      - traefik.http.routers.awstats-https.entrypoints=https&lt;br /&gt;
      - &amp;#039;traefik.http.routers.awstats-https.rule=Host(`awstats.example.com`)&amp;#039;&lt;br /&gt;
      - traefik.http.routers.awstats-https.tls=true&lt;br /&gt;
      # - traefik.http.routers.awstats-https.tls.certresolver=letsencrypt&lt;br /&gt;
      - traefik.http.routers.awstats-https.service=awstats-https&lt;br /&gt;
      - traefik.http.services.awstats-https.loadbalancer.server.port=80&lt;br /&gt;
&lt;br /&gt;
networks:&lt;br /&gt;
  internal:&lt;br /&gt;
    internal: true&lt;br /&gt;
  traefik:&lt;br /&gt;
    name: traefik&lt;br /&gt;
    external: true&lt;br /&gt;
| lang = yaml&lt;br /&gt;
}}&lt;br /&gt;
To process existing Traefik logs, enter the container and then run:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # /usr/lib/awstats/cgi-bin/awstats.pl -update -config=example.com -LogFile=&amp;quot;zcat /logs/access.log-rotated.gz {{!}}&amp;quot;&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
If you only have a single access.log file for all your hosts, you may tack on an extra grep to filter out only log entries that you&amp;#039;re interested in. For example:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # /usr/lib/awstats/cgi-bin/awstats.pl -update -config=example.com -LogFile=&amp;quot;zcat /logs/access.log-rotated.gz {{!}} grep -E &amp;#039;example{{!}}my-webapp&amp;#039; {{!}} &amp;quot;&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Leo</name></author>
	</entry>
</feed>