GoAccess is an analytic tool used to provide real-time stats by continuously monitoring web server logs. CWP offers its GUI web version that displays detailed statistics, with tables and graphs, on traffic and/or visitors to websites. It can break down visitors by the time of day, month, and year and provide information on the visiting IPs, user agents, origins, and more.
This article will demonstrate how to view statistics with GoAccess in CWP through both the graphical panel interface and the command line.
- Log into the CWP User Dashboard
- Click to expand CWP Settings
- Click on Statistics
- Under Domain, click the drop-down arrow to select a domain
- Select a daily, weekly, or monthly frequency
- Under Data, choose a date then click on Generate
Via The Command Line
- SSH into the CWP server
- Confirm goaccess is installed by checking its version
goaccess --versionor the location of its configuration filegoaccess --dcf - Install it if it isn't with
yum install goaccess -y, otherwise, move to the next step - Run goaccess commands on access logs as depicted below
-
On a specific domain
goaccess /usr/local/apache/domlogs/domain.com.logREPLACE: domain.com with the actual domain name.
-
On the main web server's access log
goaccess /usr/local/apache/logs/access_logImportant: append
--log-format=COMMONto the command if a format error is displayed or uncomment its log-format line in the Common Log Format (CLF) section at goaccess configuration filesed -i.bak_$(date -I) 's/#log-format \%h \%\^\[\%d:\%t \%\^\] \"\%r\" \%s \%b/log-format \%h \%\^\[\%d:\%t \%\^\] \"\%r\" \%s \%b/' `goaccess --dcf`.
-
- Examples of useful options
-
Monitor an access log with real-time filtering and parsing
tail -f /usr/local/apache/logs/domlogs/domain.com.log | goaccess - -
Monitor bots' activity on the server in real-time
tail -F /usr/local/apache/logs/domlogs/domain.com.log | goaccess --crawlers-only - -
Process an archived log file as well as the current one
zcat domain.com.log.gz | goaccess domain.com.log -
-
INTERACTIVE KEYS
-
F1orhMain help. -
F5Redraw main window. -
qQuit the program, current window or collapse active module -
oorENTERExpand selected module or open window -
0-9andShift + 0Set selected module to active -
jScroll down within expanded module -
kScroll up within expanded module -
cSet or change scheme color -
^ fScroll forward one screen within active module -
^ bScroll backward one screen within active module -
TABIterate modules (forward) -
SHIFT + TABIterate modules (backward) -
sSort options for active module -
/Search across all modules (regex allowed) -
nFind position of the next occurrence -
gMove to the first item or top of screen -
Gmove to the last item or bottom of screen
Reference: goaccess manual page https://goaccess.io/man
Comments
0 comments
Article is closed for comments.