设为首页 收藏本站
查看: 862|回复: 0

[经验分享] Install GoAccess Apache Log Analyzer Tool onUbuntu-Arnold

[复制链接]

尚未签到

发表于 2018-11-17 12:35:15 | 显示全部楼层 |阅读模式
  GoAccess is a free, open source and real time web server log analyzer tool that can be used to analyze and view web server logs. GoAccess is based on command line and also produces HTML reports that can be viewed through a web browser. It has several features including, General Statistics, bandwidth, Different Color Schemes, Top Visitors, Referring Sites & URLs, Operating Systems, Browsers, Metrics per Virtual Host and much more.
  In this tutorial, we will learn how to install GoAccess in Ubuntu 16.04 server.
Requirements

  •   A server running Ubuntu 16.04.
  •   A non-root user with sudo privileges.
Getting Started
  Before starting, it is recommended to update your system with the latest version. You can do this by running the following command:
  sudo apt-get update -y
  sudo apt-get upgrade -y
  Once your system is updated, restart the system to apply all the updates.
Install Required Dependencies
  GoAccess is written in the C programming language, so you will need to install some dependencies required by GoAccess. You can install all of them with the following command:
  sudo apt-get -y install libncursesw5-dev gcc make libgeoip-dev libtokyocabinet-dev build-essential -y
  Once all the dependencies are installed, you can proceed to the next step.
Install Apache Web Server
  GoAccess is a web server log analyzer tool, so you will need to install Apache to your system. You can install it with the following command:
  sudo apt-get install apache2 -y
  Once the Apache is installed, start the apache service and enable it to start on boot time:
  sudo systemctl start apache2
  sudo systemctl enable apache2
Install GoAccess
  You can install GoAccess using either from GoAccess source or from Ubuntu repository.
Install GoAccess from Source
  First, you will need to download the latest version of the GoAccess from their official website with the following command:
  wget http://tar.goaccess.io/goaccess-1.2.tar.gz
  Next, extract the downloaded file with the following command:
  tar -xzvf goaccess-1.2.tar.gz
  Next, change the directory to the goaccess-1.2 and compile GoAccess by running the following command:
  cd goaccess-1.2
  sudo ./configure --enable-utf8 --enable-geoip=legacy
  sudo make
  sudo make install
Install GoAccess from Repository
  First, you will need to add the GoAccess repository to the APT. You can do this with the following command:
  echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list
  wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add -
  Next, update the repository using the following command:
  sudo apt-get update -y
  Finally, install GoAccess by running the following command:
  sudo apt-get install goaccess -y
Use GoAccess
  GoAccess is now installed, it's time to test it with Apache web server.
  First, open access your Apache web server using the URL http://your-server-ip. After accessing the Web server, Apache will add some log entries in the default access_log file.
  Now, you can analyze the Apache web server log from a terminal using the following command:
  sudo goaccess /var/log/apache2/access.log --log-format=COMBINED
  You should see the Apache web server log report in the following image:
DSC0000.png

  You can also generate an HTML report with the following command:
  sudo goaccess /var/log/apache2/access.log --log-format=COMBINED -a -o /var/www/html/report.html
  Once the report is generated, open your web browser and type the URL http://your-server-ip/report.html. You should see the report generated by GoAccess in the following image:
DSC0001.png

DSC0002.png

DSC0003.png

DSC0004.png

DSC0005.png

  Congratulations! you have successfully installed GoAccess in Ubuntu 16.04 server. You can now easily analyze Apache web server log from a web interface and CLI.


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-636227-1-1.html 上篇帖子: CentOS7.4 部署 Django + Python3 + Apache + Mod_wsgi 下篇帖子: Docker 容器部署Apache静态网站
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表