{"id":13800,"date":"2019-04-06T09:08:38","date_gmt":"2019-04-06T09:08:38","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13800"},"modified":"2019-04-06T09:08:38","modified_gmt":"2019-04-06T09:08:38","slug":"how-to-monitor-apache-performance-using-netdata-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-monitor-apache-performance-using-netdata-on-centos-7\/","title":{"rendered":"How to Monitor Apache Performance using Netdata on CentOS 7"},"content":{"rendered":"<p><a href=\"https:\/\/www.tecmint.com\/netdata-real-time-linux-performance-network-monitoring-tool\/\" target=\"_blank\" rel=\"noopener\">Netdata<\/a>\u00a0is a free open source, simple yet powerful, and effective real-time system performance monitoring tool for Linux, FreeBSD and MacOS. It supports various plugins for monitoring general server status, applications, web services such as\u00a0<strong>Apache<\/strong>\u00a0or\u00a0<strong>Nginx HTTP<\/strong>\u00a0server and so much more.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/monitor-nginx-performance-using-netdata-on-centos-7\/\" target=\"_blank\" rel=\"noopener\">How to Monitor Nginx Performance Using Netdata on CentOS 7<\/a><\/p>\n<p>In this article, we will explain how to monitor\u00a0<strong>Apache HTTP<\/strong>\u00a0server performance using\u00a0<strong>Netdata<\/strong>\u00a0performance monitoring tool on a\u00a0<strong>CentOS 7<\/strong>\u00a0or\u00a0<strong>RHEL 7<\/strong>\u00a0distribution. At the end of this article, you will be able to watch visualizations of requests, bandwidth, workers, and other Apache server metrics.<\/p>\n<h4>Requirements:<\/h4>\n<ol>\n<li>A\u00a0<a href=\"https:\/\/www.tecmint.com\/centos-7-3-installation-guide\/\" target=\"_blank\" rel=\"noopener\">CentOS 7 Server<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/red-hat-enterprise-linux-7-3-installation-guide\/\" target=\"_blank\" rel=\"noopener\">RHEL 7 Server<\/a>\u00a0with Minimal Install.<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/install-apache-on-centos-7\/\" target=\"_blank\" rel=\"noopener\">Apache HTTP server installation<\/a>\u00a0with\u00a0<a href=\"https:\/\/www.tecmint.com\/check-apache-modules-enabled\/\" target=\"_blank\" rel=\"noopener\">mod_status module enabled<\/a>.<\/li>\n<\/ol>\n<h3>Step 1: Install Apache on CentOS 7<\/h3>\n<p><strong>1.<\/strong>\u00a0First start by installing\u00a0<strong>Apache HTTP<\/strong>\u00a0server from the default software repositories using the\u00a0<a href=\"https:\/\/www.tecmint.com\/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement\/\" target=\"_blank\" rel=\"noopener\">YUM package manager<\/a>.<\/p>\n<pre># yum install httpd\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0After you have installed\u00a0<strong>Apache<\/strong>\u00a0web server, start it for the first time, check if it is up and running, and enable it to start automatically at system boot using following commands.<\/p>\n<pre># systemctl start httpd\r\n# systemctl enable httpd\r\n# systemctl status httpd\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0If you are running a firewall for example\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-firewalld-in-centos-7\/\" target=\"_blank\" rel=\"noopener\">firewalld<\/a>, you need to open the ports\u00a0<strong>80<\/strong>\u00a0and\u00a0<strong>443<\/strong>\u00a0to allow web traffic to\u00a0<strong>Apache<\/strong>\u00a0via\u00a0<strong>HTTP<\/strong>\u00a0and\u00a0<strong>HTTPS<\/strong>\u00a0respectively, using the commands below.<\/p>\n<pre># firewall-cmd --zone=public --permanent --add-port=80\/tcp\r\n# firewall-cmd --zone=public --permanent --add-port=443\/tcp\r\n# firewall-cmd --reload \r\n<\/pre>\n<h3>Step 2: Enable Mod_Status Module in Apache<\/h3>\n<p><strong>4.<\/strong>\u00a0In this step, you need to enable and configure\u00a0<strong>mod_status<\/strong>\u00a0module in\u00a0<strong>Apache<\/strong>, this is required by\u00a0<strong>Netdata<\/strong>\u00a0for gathering server status information and statistics.<\/p>\n<p>Open the file\u00a0<strong>\/etc\/httpd\/conf.modules.d\/00-base.conf<\/strong>\u00a0file using your favorite editor.<\/p>\n<pre># vim \/etc\/httpd\/conf.modules.d\/00-base.conf\r\n<\/pre>\n<p>And ensure that the line below is uncommented to enable\u00a0<strong>mod_status<\/strong>\u00a0module, as shown in the screenshot.<\/p>\n<div id=\"attachment_29706\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Enable-mod_status-Module-in-Apache.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29706\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Enable-mod_status-Module-in-Apache.png\" alt=\"Enable Mod_Status Module in Apache\" width=\"722\" height=\"363\" aria-describedby=\"caption-attachment-29706\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29706\" class=\"wp-caption-text\">Enable Mod_Status Module in Apache<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0Once you\u2019ve enabled\u00a0<strong>mod_status<\/strong>, next you need to create a\u00a0<code>server-status.conf<\/code>\u00a0configuration file for the Apache server status page.<\/p>\n<pre># vim \/etc\/httpd\/conf.d\/server-status.conf\r\n<\/pre>\n<p>Add the following configuration inside the file.<\/p>\n<pre>&lt;Location \"\/server-status\"&gt;\r\n    SetHandler server-status\r\n    #Require host localhost           #uncomment to only allow requests from localhost \r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>Save the file and close. Then restart the Apache HTTPD service.<\/p>\n<pre># systemctl restart httpd\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0Next, you need to verify that the Apache server status and statistics page is working well by using a\u00a0<a href=\"https:\/\/www.tecmint.com\/command-line-web-browsers\/\" target=\"_blank\" rel=\"noopener\">command-line web browser<\/a>\u00a0such as\u00a0<strong>lynx<\/strong>\u00a0as shown.<\/p>\n<pre># yum install lynx\r\n# lynx http:\/\/localhost\/server-status   \r\n<\/pre>\n<div id=\"attachment_29707\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Server-Status.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29707\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Server-Status.png\" sizes=\"auto, (max-width: 922px) 100vw, 922px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Server-Status.png 922w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Server-Status-768x587.png 768w\" alt=\"Check Apache Server Status\" width=\"922\" height=\"705\" aria-describedby=\"caption-attachment-29707\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29707\" class=\"wp-caption-text\">Check Apache Server Status<\/p>\n<\/div>\n<h3>Step 3: Install Netdata on CentOS 7<\/h3>\n<p><strong>7.<\/strong>\u00a0Fortunately, there is a kickstarter shell script for painlessly installing\u00a0<strong>netdata<\/strong>\u00a0from its github repository. This one-liner script downloads a second script which checks your Linux distribution and installs the required system packages for building netdata, then downloads the latest netdata source tree; builds and installs it on your server.<\/p>\n<p>You can start the kickstarter script as shown, the\u00a0<strong>all<\/strong>\u00a0flag allows for installing required packages for all netdata plugins including the ones for Apache HTTP server.<\/p>\n<pre># bash &lt;(curl -Ss https:\/\/my-netdata.io\/kickstart.sh) all\r\n<\/pre>\n<p>Note that if your not administering your system as\u00a0<strong>root<\/strong>, you will be prompted to enter your user password for\u00a0<a href=\"https:\/\/www.tecmint.com\/su-vs-sudo-and-how-to-configure-sudo-in-linux\/\" target=\"_blank\" rel=\"noopener\">sudo command<\/a>, and you will also be asked to confirm a number of functions by pressing\u00a0<strong>[Enter]<\/strong>.<\/p>\n<div id=\"attachment_29708\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Install-Netdata-on-CentOS-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29708\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Install-Netdata-on-CentOS-7.png\" alt=\"Install Netdata on CentOS 7\" width=\"698\" height=\"677\" aria-describedby=\"caption-attachment-29708\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29708\" class=\"wp-caption-text\">Install Netdata on CentOS 7<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0Once the script has completed building and installing netdata, it will automatically start the\u00a0<strong>netdata<\/strong>\u00a0service via\u00a0<strong>systemd<\/strong>\u00a0service manager and enables it to start at system boot.<\/p>\n<div id=\"attachment_29709\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Netdata-Installation-Summary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29709\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Netdata-Installation-Summary.png\" alt=\"Netdata Installation Summary\" width=\"698\" height=\"542\" aria-describedby=\"caption-attachment-29709\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29709\" class=\"wp-caption-text\">Netdata Installation Summary<\/p>\n<\/div>\n<p>By default,\u00a0<strong>netdata<\/strong>\u00a0listens on port\u00a0<strong>19999<\/strong>, you will access the web UI using this port. So, open port\u00a0<strong>19999<\/strong>\u00a0in the firewall to access the netdata web UI.<\/p>\n<pre># firewall-cmd --permanent --add-port=19999\/tcp\r\n# firewall-cmd --reload \r\n<\/pre>\n<h3>Step 4: Configure Netdata to Monitor Apache Performance<\/h3>\n<p><strong>9.<\/strong>\u00a0The netdata configuration for Apache plugin is\u00a0<strong>\/etc\/netdata\/python.d\/apache.conf<\/strong>, this file is written in\u00a0<strong>YaML<\/strong>\u00a0format, you can open it using your favorite editor.<\/p>\n<pre># vim \/etc\/netdata\/python.d\/apache.conf\r\n<\/pre>\n<p>The default configuration is just enough to get you started with monitoring your Apache HTTP server.<\/p>\n<div id=\"attachment_29710\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/netdata-config-for-apache-plugin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29710\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/netdata-config-for-apache-plugin.png\" alt=\"Netdata Configuration for Apache\" width=\"662\" height=\"439\" aria-describedby=\"caption-attachment-29710\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29710\" class=\"wp-caption-text\">Netdata Configuration for Apache<\/p>\n<\/div>\n<p>However, if you have read the documentation, and made any changes to it, restart the\u00a0<strong>netdata<\/strong>\u00a0service to effect the changes.<\/p>\n<pre># systemctl restart netdata \r\n<\/pre>\n<h3>Step 5: Monitor Apache Performance Using Netdata<\/h3>\n<p><strong>10.<\/strong>\u00a0Next, open a web browser and use the following URL to access the netdata web UI.<\/p>\n<pre>http:\/\/domain_name:19999\r\nOR\r\nhttp:\/\/SERVER_IP:19999\r\n<\/pre>\n<p>From the netdata dashboard, search for \u201c<strong>Apache local<\/strong>\u201d on the right hand side list of plugins, and click on it to start monitoring your Apache server. You will be able to watch visualizations of requests, bandwidth, workers, and other server statistics, as shown in the following screenshot.<\/p>\n<div id=\"attachment_29711\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Monitor-Apache-Performance-using-netdata.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29711\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Monitor-Apache-Performance-using-netdata.png\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Monitor-Apache-Performance-using-netdata.png 1366w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Monitor-Apache-Performance-using-netdata-768x401.png 768w\" alt=\"Monitor Apache Performance Using Netdata\" width=\"1366\" height=\"713\" aria-describedby=\"caption-attachment-29711\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29711\" class=\"wp-caption-text\">Monitor Apache Performance Using Netdata<\/p>\n<\/div>\n<p><strong>Netdata Github repository<\/strong>:\u00a0<a href=\"https:\/\/github.com\/firehol\/netdata\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/firehol\/netdata<\/a><\/p>\n<p>That\u2019s all! In this article, we\u2019ve explained how to monitor\u00a0<strong>Apache<\/strong>\u00a0performance using\u00a0<strong>Netdata<\/strong>\u00a0on\u00a0<strong>CentOS 7<\/strong>. If you have any questions or additional thoughts to share, please reach us via the comment form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/monitor-apache-performance-using-netdata-on-centos\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Netdata\u00a0is a free open source, simple yet powerful, and effective real-time system performance monitoring tool for Linux, FreeBSD and MacOS. It supports various plugins for monitoring general server status, applications, web services such as\u00a0Apache\u00a0or\u00a0Nginx HTTP\u00a0server and so much more. Read Also:\u00a0How to Monitor Nginx Performance Using Netdata on CentOS 7 In this article, we will &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-monitor-apache-performance-using-netdata-on-centos-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Monitor Apache Performance using Netdata on CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13800","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13800"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13800\/revisions"}],"predecessor-version":[{"id":13801,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13800\/revisions\/13801"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}