How to Install GoAccess Web Analytics on Debian Updated on August 16, 2021 by InMotion Hosting Contributor 3 Minutes, 21 Seconds to Read GoAccess is a light-weight free open source log analyzer. Matomo and other self-hosted website analytics applications use PHP and a SQL database to manage web analytics data. Other applications including Google Analytics and Mixpanel store the data externally. GoAccess uses your pre-existing server logs to provide web analytics data you can easily manipulate within your web browser, spreadsheet application, or command-line interface. There are a few advantages to this: Faster, easier configuration with automated CLI tasksMore security on cloud servers since system administrators (sysadmins) don’t need to install PHP and MySQLAnother option for users on cPanel servers wanting to know how to check server error logs outside of cPanel with a sleek GUI Below we cover: How to install GoAccess on DebianHow to configure GoAccess for ApacheHow to create a GoAccess ReportHTMLTerminal Experienced sysadmins may not want cPanel. You may only need secure, Debian Cloud Server Hosting. Install GoAccess Log into SSHCreate a file for the official GoAccess repo: echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.listDownload the GoAccess GPG key to ensure you install a verified GoAccess application: wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/goaccess.gpg add -Update your system repositories: sudo apt-get updateInstall GoAccess: sudo apt-get install goaccess Configure GoAccess for Apache There are multiple ways to configure GoAccess reporting for your server environment. If the time format is configured wrong, or not at all, you’ll likely receive the following error with GoAccess log parsing commands: GoAccess - version 1.4 - May 18 2020 01:28:37Config file: /etc/goaccess/goaccess.confFatal error has occurredError occurred at: src/parser.c - parse_log - 2777No time format was found on your conf file. The easiest way to quickly get started with GoAccess is use --log-format=COMBINED: goaccess /var/log/apache2/access.log -a -o /var/www/html/report-07172020.html --log-format=COMBINED Below we’ll cover the manual method for configuring GoAccess permanently so that you can use less options when producing GoAccess reports. Edit your GoAccess configuration file: nano /etc/goaccess/goaccess.confUn-comment (meaning remove the # in the beginning of) line 13, under Apache/NGINX's log formats below: time-format %H:%M:%STo jump to line numbers with Nano, type Ctrl + Shift + _, then the line number, and Enter.Un-comment line 36, under Apache/NGINX's log formats below: date-format %d/%b/%YUn-comment line 70, under Common Log Format (CLF): log-format %h %^[%d:%t %^] "%r" %s %bUn-comment line 330, under priority over -f from the command line: log-file /var/log/apache2/access.logExit the file and save changes: Ctrl + X , Y, then Enter Create a GoAccess Report GoAccess allows you to create reports in multiple formats – terminal, HTML, CSV (for spreadsheets), and JSON (for APIs). Create a GoAccess Report in the Terminal Specify a log file with the -c option:goaccess /var/log/apache2/access.log -c Scroll down and select [ ] Common Log Format (CLF) with the space bar, then EnterScroll through the different sections of results with the up and down arrows Create a HTML GoAccess Report for the Web Browser If you haven’t configured your GoAccess configuration file, you can use the following commands to create an HTML report: goaccess /var/log/apache2/access.log -a -o /var/www/html/report.html --log-format=COMBINED If you’ve configured your GoAccess configuration file, you can omit the log format: goaccess /var/log/apache2/access.log -a -o /var/www/html/report.html If you wish to use all access log files available, not just for the current day, you can use zcat to feed archived log files into your GoAccess log parse: zcat -f /var/log/apache2/access.log.* | goaccess -o /var/www/html/report.html Below is a completed HTML report example. The two buttons on the left serve two major functions: Skip to different panels (log sections)Change the report appearance – color theme, items (rows) shown at once in each section, and more Learn how to do more with your logs in the online GoAccess manual. Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Secure Matomo Analytics With The Security Info Plugin How to Migrate to Google Analytics 4 From UA How to Include Google Analytics Tracking Code with PHP Enabling Google Analytics in Koken Adding Google Analytics to Ghost Debug Google Analytics with Google Analytics Debugger How to use Google Analytics with PHP-Nuke Adding Google Analytics to a Container in Google Tag Manager How to Google Analytics to WordPress Without a Plugin Installing Google Analytics on Your Website