MCPSERV.CLUB
AWStats

AWStats

Self-Hosted

Advanced web log analytics in a single tool

Active(84)
412stars
1views
Updated 12 days ago
AWStats screenshot 1
1 / 4

Overview

Discover what makes AWStats powerful

AWStats is a mature, Perl‑based log analyzer that turns raw web server logs into richly formatted statistical reports. From a developer’s standpoint, it operates as both a command‑line utility and a CGI script, enabling automation via cron jobs or real‑time updates through the web interface. The core engine parses a wide spectrum of log formats—Apache (combined, CLF), IIS (W3C), NCSA, WebStar, and even mail/FTP logs—extracting timestamps, IPs, URLs, user agents, and response codes. It then builds an internal database (default XML or optional SQLite) that powers a suite of reports: visitor counts, bandwidth usage, referrer analysis, search‑engine keywords, robot detection, and more. The modular design allows developers to plug in custom parsers or extend the reporting pipeline without touching the core codebase.

Multi‑format Log Support

Virtual Host & Multi‑Domain

Real‑time & Batch Processing

Geolocation & DNS

Overview

AWStats is a mature, Perl‑based log analyzer that turns raw web server logs into richly formatted statistical reports. From a developer’s standpoint, it operates as both a command‑line utility and a CGI script, enabling automation via cron jobs or real‑time updates through the web interface. The core engine parses a wide spectrum of log formats—Apache (combined, CLF), IIS (W3C), NCSA, WebStar, and even mail/FTP logs—extracting timestamps, IPs, URLs, user agents, and response codes. It then builds an internal database (default XML or optional SQLite) that powers a suite of reports: visitor counts, bandwidth usage, referrer analysis, search‑engine keywords, robot detection, and more. The modular design allows developers to plug in custom parsers or extend the reporting pipeline without touching the core codebase.

Architecture

AWStats is written entirely in Perl 5, leveraging CPAN modules for tasks such as IP geolocation (Geo::IP), DNS resolution, and XML handling. The application follows a classic MVC‑like pattern: the model is the parsed log data stored in an XML or SQLite database; the view consists of XSLT stylesheets and optional CSS for HTML output, while the controller is a set of Perl scripts (awstats.pl, awstats.plcgi) that orchestrate parsing, database updates, and report generation. The CGI mode uses CGI.pm for request handling, exposing query parameters that filter reports (e.g., date ranges, virtual hosts). AWStats ships with a lightweight Webmin module for integration into hosting control panels. The codebase is open‑source under GPLv3, encouraging community contributions and custom forks.

Core Capabilities

  • Multi‑format Log Support: Handles Apache, IIS, NCSA, WebStar, and various proxy/streaming server logs with optional user‑defined formats.
  • Virtual Host & Multi‑Domain: Parses vhost entries, enabling separate analytics per domain without manual segmentation.
  • Real‑time & Batch Processing: Supports on‑demand updates via CGI and scheduled batch runs, using a partial information file (awstats.last.log) to avoid re‑processing unchanged data.
  • Geolocation & DNS: Optional reverse DNS lookup, country detection via IP or domain name, and WhoIS links for enriched reports.
  • Customizable Reporting: XSLT templates can be overridden to generate PDFs, CSVs, or custom dashboards; CSS styling hooks allow brand‑consistent visualizations.
  • Extensibility: Developers can write Perl plugins that hook into the parsing or reporting phases, and AWStats exposes a simple API through CGI parameters for external applications to trigger updates or fetch specific metrics.

Deployment & Infrastructure

AWStats is self‑hosted and platform agnostic—running on Linux, Windows NT/OS 2, BSD, Solaris, or even BeOS. It requires a Perl interpreter (5.10+ recommended) and standard CGI support on the web server. For scalability, AWStats can be containerized using Docker; a minimal image simply mounts the log directory and configures environment variables for AWSTATS_HOME and AWSTATS_CONF. In high‑traffic environments, the SQLite backend reduces I/O contention compared to XML files, and the partial file mechanism limits parsing time to only new log entries. Horizontal scaling is achievable by distributing logs across multiple instances and aggregating the resulting databases with a custom merge script.

Integration & Extensibility

The plugin architecture allows developers to inject custom logic at three key points: before parsing (%preprocess), during data aggregation (%aggregate), and when rendering reports (%postprocess). External services can trigger AWStats updates via HTTP POST requests to the CGI endpoint, passing authentication tokens. Additionally, AWStats can output JSON snippets via custom XSLT, enabling consumption by modern dashboards (Grafana, Kibana). The Webmin module offers API hooks for provisioning and monitoring, making it a natural fit for shared hosting environments.

Developer Experience

Configuration is consolidated into a single awstats.conf file, written in INI style. Most settings are self‑documented with comments, and the project includes comprehensive documentation (docs/) covering every feature. The community is active on GitHub, with frequent issue tracking and pull requests for bug fixes and new parser support. The GPLv3 license removes commercial restrictions, encouraging private forks or integration into proprietary systems without licensing headaches.

Use Cases

  • Shared Hosting Panels: Integrate AWStats into cPanel, Plesk, or custom control panels to provide users with instant analytics.
  • Enterprise Log Analysis: Deploy in a container fleet to aggregate logs from multiple web servers, feeding data into internal dashboards.
  • Compliance & Security Auditing: Leverage robot and attack detection features to monitor for malicious activity in real time.
  • Marketing Insights: Use keyword and referrer reports to refine SEO strategies within a self‑hosted analytics stack.

Advantages

AWStats offers performance through incremental parsing and lightweight data storage, making it suitable for large log files that would overwhelm other tools. Its flexibility stems from the Perl base and XSLT templating, allowing developers to tailor reports down to a pixel. The licensing model (GPLv3) guarantees that the source remains free and modifiable, a critical factor for enterprises with strict internal compliance. Compared to alternatives like Webalizer or Analog, AWStats provides richer analytics (e.g., keyword analysis,

Open SourceReady to get started?

Join the community and start self-hosting AWStats today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
data-analysis
License
GPL-3.0
Stars
412
Technical Specs
Pricing
Open Source
Database
None
Supported OS
LinuxWindowsBSD
Author
eldy
eldy
Last Updated
12 days ago