I just did a rough set up, and manually setup AwStats seems to work on my OpenLiteSpeed web server.
- Install AwStats
sudo apt install awstats
which you already did.
- Set up the AwStats config. Please add following entries to /etc/awstats/awstats.conf:
- Include "/etc/awstats/awstats.conf.local"
- LogFile="/var/www/html/logs/access.log"
- SiteDomain="example.com"
- HostAliases="example.com localhost 127.0.0.1"
- AllowToUpdateStatsFromBrowser=1
Note, please make sure to substitute the example.com domain name and the access log path with your own settings.
- Verify your AwStats settings
Build your initial statistics which is generated from the current logs,
/usr/lib/cgi-bin/awstats.pl -config=example.com -update
Example returns:
From data in log file "/var/www/html/logs/access.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 50)
Jumped lines in file: 50
Found 50 already parsed records.
Parsed lines in file: 146
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 0 corrupted records,
Found 0 old records,
Found 146 new qualified records.
If there's no error in the output, we can start setting up the Awstats display
- Display Awstats
Add symlink for both cgi-bin and icons to your document root
ln -sf /usr/lib/cgi-bin /var/www/html/cgi-bin
ln -sf /usr/share/awstats/icon/* /var/www/html/awstats-icon
Navigate to Web Admin at port 7080 > VirtualHosts > Name > Context, then create a CGI context
- URI=/cgi-bin/
- Path=/var/www/html/cgi-bin
Click Save button and gracefully restart the web server.
Now you can access your AwStats by visiting the URL, http://your-server-ip/cgi-bin/awstats.pl?config=example.com
