{"id":4007,"date":"2019-08-18T00:50:43","date_gmt":"2019-08-17T21:50:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4007"},"modified":"2019-08-18T10:56:59","modified_gmt":"2019-08-18T07:56:59","slug":"install-goaccess-on-ubuntu-18-04-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-goaccess-on-ubuntu-18-04-debian-10-buster\/","title":{"rendered":"Install GoAccess on Ubuntu 18.04\/Debian 10 Buster"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/live-demo.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"653\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/live-demo.png\" alt=\"Install GoAccess on Ubuntu 18.04\/Debian 10 Buster\" class=\"wp-image-4016\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/live-demo.png 1348w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/live-demo-768x372.png 768w\" sizes=\"(max-width: 1348px) 100vw, 1348px\" \/><\/a><\/figure>\n\n\n\n<p>In this guide, we are going to learn how to install GoAccess on Ubuntu 18.04\/Debian 10 Buster. <a rel=\"noreferrer noopener\" aria-label=\"GoAccess (opens in a new tab)\" href=\"https:\/\/goaccess.io\/\" target=\"_blank\">GoAccess<\/a> is an open-source real-time web log analyzer and interactive viewer that runs in a&nbsp;terminal&nbsp;and on web browsers in Linux\/Unix systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install GoAccess on Ubuntu 18.04\/Debian 10 Buster<\/h2>\n\n\n\n<p>GoAccess is available on the default Bionic or Buster repositories. However, the available versions may be not be the latest versions. You can confirm this by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-cache policy goaccess<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>goaccess:\n  Installed: (none)\n  Candidate: 1:1.2-4+b10\n  Version table:\n     1:1.2-4+b10 500\n        500 http:\/\/deb.debian.org\/debian buster\/main amd64 Packages<\/code><\/pre>\n\n\n\n<p>GoAccess v1.3&nbsp;is the latest stable release as of this writing. To install the latest version, you need to add GoAccess repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install GoAccess APT Repository<\/h3>\n\n\n\n<p>Run the command below to install the GoAccess APT repository on both Bionic and Buster.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"deb http:\/\/deb.goaccess.io\/ $(lsb_release -cs) main\" | sudo tee -a \/etc\/apt\/sources.list.d\/goaccess.list<\/code><\/pre>\n\n\n\n<p>Next, install the GoAccess repository signing key.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget -O - https:\/\/deb.goaccess.io\/gnugpg.key | sudo apt-key add -<\/code><\/pre>\n\n\n\n<p>On Debian 10 Buster, you might need to install gnupg2 just in case you encounter the error, <strong>Cannot write to \u2018-\u2019 (Broken pipe)<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install gnupg2<\/code><\/pre>\n\n\n\n<p>Once that is done, run system update to resynchronize packages to their latest versions.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>You can now verify that GoAccess v1.3 is available for download.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-cache policy goaccess<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>goaccess:\n  Installed: (none)\n  Candidate: 1:1.3-1\n  Version table:\n     1:1.3-1 500\n        500 http:\/\/deb.goaccess.io buster\/main amd64 Packages\n     1:1.2-4+b10 500\n        500 http:\/\/deb.debian.org\/debian buster\/main amd64 Packages<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Required Dependencies<\/h3>\n\n\n\n<p>The only mandatory dependency for GoAccess is <strong>NCurses<\/strong> (libncursesw5-dev) which is installed automatically if you install GoAccess from APT. However, the command below installs ncurses and other optional dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install libncursesw5-dev libgeoip-dev libmaxminddb-dev libtokyocabinet-dev libssl-dev<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install GoAccess on Ubuntu 18.04\/Debian 10<\/h3>\n\n\n\n<p>Now that you have the GoAccess repos in place, run the command below to install it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install goaccess<\/code><\/pre>\n\n\n\n<p>GoAccess is compiled with support for <strong>libssl1.0.2<\/strong>. However, Debian 10 Buster installs libssl1.1 which doesn&#8217;t meet GoAccess dependency issue. Hence, if you get the error;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>The following packages have unmet dependencies:\n goaccess : Depends: libssl1.0.2 (>= 1.0.2) but it is not installable\nE: Unable to correct problems, you have held broken packages.<\/code><\/pre>\n\n\n\n<p>Simply download <strong>libssl1.0.2<\/strong> and install it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget http:\/\/ftp.br.debian.org\/debian\/pool\/main\/o\/openssl1.0\/libssl1.0.2_1.0.2r-1~deb9u1_amd64.deb\napt install .\/libssl1.0.2_1.0.2r-1~deb9u1_amd64.deb<\/code><\/pre>\n\n\n\n<p>Then proceed to install GoAccess on Debian 10.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install goaccess<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Run GoAccess<\/h2>\n\n\n\n<p>To obtain <strong>goaccess<\/strong> command line usage, run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code>goaccess --help<\/code><\/pre>\n\n\n\n<p>The most basic usage is to pass the log to analyse to GoAccess. For example;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>goaccess \/var\/log\/apache2\/access.log<\/code><\/pre>\n\n\n\n<p>This will open a Log, date and time format configuration prompt.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/log-date-time.png\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"467\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/log-date-time.png\" alt=\"Install GoAccess on Ubuntu 18.04\/Debian 10 Buster\" class=\"wp-image-4011\" title=\"\"><\/a><\/figure>\n\n\n\n<p>Press space bar to select the format and press Enter to analyze the logs. The log analysis dashboard is presented on the terminal.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-dashboards.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1356\" height=\"726\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-dashboards.png\" alt=\"GoAccess dashboards\" class=\"wp-image-4012\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-dashboards.png 1356w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-dashboards-768x411.png 768w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/><\/a><\/figure>\n\n\n\n<p>Scroll up and down to view dashboards.<\/p>\n\n\n\n<p>If the logs being analyzed doesn't support the default log formats for GoAccess, you can specify your log format, date and time format with the options, <strong>--log-format<\/strong>, <strong>--date-format<\/strong> and <strong>--time-format<\/strong>.<\/p>\n\n\n\n<p>For example, if you have squid logs with the EPOCH timestamp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>goaccess \/var\/squid\/logs\/access.log --log-format='%x.%^ %~ %L %h %^\/%s %b %m %U %^' --date-format=%s --time-format=%s<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/squid-logs-analysis.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1354\" height=\"724\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/squid-logs-analysis.png\" alt=\"GoAccess Squid Logs analysis\" class=\"wp-image-4013\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/squid-logs-analysis.png 1354w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/squid-logs-analysis-768x411.png 768w\" sizes=\"(max-width: 1354px) 100vw, 1354px\" \/><\/a><\/figure>\n\n\n\n<p>If you need to display the analysis on a web format,  save the output of a log file into an HTML file on your web root directory. In this case, you need to have a web server installed, we are using Apache in this guide,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install apache2<\/code><\/pre>\n\n\n\n<p>To generate a web report, for Apache Access logs;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>goaccess \/var\/log\/apache2\/access.log --log-format=COMBINED -a -o \/var\/www\/html\/analysis.html<\/code><\/pre>\n\n\n\n<p>If you access your browser via <strong>http:\/\/&lt;server-IP&gt;\/analysis.html<\/strong> you should be able to see your GoAccess analytic dashboards.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1356\" height=\"656\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report.png\" alt=\"GoAccess Web Reports for apache access logs\" class=\"wp-image-4014\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report.png 1356w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report-768x372.png 768w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/><\/a><\/figure>\n\n\n\n<p>For analyzing squid logs with custom format;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>goaccess \/var\/squid\/logs\/access.log --log-format='%x.%^ %~ %L %h %^\/%s %b %m %U %^' --date-format=%s --time-format=%s -a -o \/var\/www\/html\/analysis.html<\/code><\/pre>\n\n\n\n<p>Access the report via <strong>http:\/\/&lt;server-IP&gt;\/analysis.html<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report-squid-logs.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1349\" height=\"655\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report-squid-logs.png\" alt=\"Goaccess squid logs analysis\" class=\"wp-image-4015\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report-squid-logs.png 1349w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/goaccess-web-report-squid-logs-768x373.png 768w\" sizes=\"(max-width: 1349px) 100vw, 1349px\" \/><\/a><\/figure>\n\n\n\n<p>To parse the logs and display the stats in a real-time HTML report, use the <strong>--real-time-html<\/strong> option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>goaccess access.log --log-format=COMBINED -a -o \/var\/www\/html\/report.html --real-time-html<\/code><\/pre>\n\n\n\n<p>You can as well monitor logs on a remote server without having to install GoAccess on those servers via SSH. For example, read remote Apache logs line by line and pass it to GoAccess;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ssh root@192.168.43.62 'while IFS= read -r line; do echo \"$line\" &amp;&amp; sleep 1 ; done &lt; \/root\/access.log' | goaccess --log-format=COMBINED -a -o \/var\/www\/html\/remote.html --real-time-html -<\/code><\/pre>\n\n\n\n<p>The report for the remote server is then available under <strong>http:\/\/&lt;server-IP>\/remote.html<\/strong>.<\/p>\n\n\n\n<p>Well that is just it on how to install GoAccess on Ubuntu 18.04\/Debian 10 Buster. To learn more about GoAccess, read the GoAccess manual page, <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/goaccess.io\/man\" target=\"_blank\">https:\/\/goaccess.io\/man<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Other Monitoring Tutorials<\/h4>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/integrate-prometheus-with-grafana-for-monitoring\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Integrate Prometheus with Grafana for Monitoring<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-grafana-6-2-x-on-ubuntu-18-04-debian-9\/\" target=\"_blank\">Install Grafana 6.2.x on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-grafana-metrics-monitoring-tool-on-debian-9\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Grafana Metrics Monitoring Tool on Debian 9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install GoAccess on Ubuntu 18.04\/Debian 10 Buster. GoAccess is an open-source real-time web log analyzer<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[1083,121,72],"tags":[1039,1084,1085,74,67],"class_list":["post-4007","post","type-post","status-publish","format-standard","hentry","category-goaccess","category-howtos","category-monitoring","tag-debian-10-buster","tag-goaccess","tag-log-analyzers","tag-monitoring","tag-ubuntu-18-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4007"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=4007"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4007\/revisions"}],"predecessor-version":[{"id":4021,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4007\/revisions\/4021"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=4007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=4007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=4007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}