If you’re reading this, you already understand the importance of keeping your Apache web servers running smoothly. Whether it’s ensuring you stay within the limits of configured server workers, tracking how many requests are being handled, or guaranteeing maximum uptime, effective Apache monitoring is the key to maintaining server performance and reliability. Fortunately, setting up Apache monitoring is straightforward and can be done in just a few steps.

This guide will take you through a simple, step-by-step process to monitor your Apache servers effectively on operating systems like Windows, covering everything from enabling necessary modules to configuring alerts and integrating with monitoring tools. By the end, you’ll be able to proactively manage your server health, catch potential issues early, and optimize your system for peak performance.

Step 1: Make sure you are loading the mod_status module.

If you are using a version of Apache that was installed by your OS’s package manager, there are OS specific ways to enable modules.

For Ubuntu/Debian:

/usr/sbin/a2enmod status

For Redhat/Centos: Just uncomment the line:

LoadModule status_module modules/mod_status.so

in /etc/httpd/conf/httpd.conf
For Suse derivatives:
add “status” to the list of modules on the line starting with APACHE_MODULES= in /etc/sysconfig/apache2

Step 2: Configure the Mod_status module

You want the following to be loaded in your apache configuration files.

ExtendedStatus On
<Location /server-status>
 SetHandler server-status
 Order deny,allow
 Deny from all
#Add LogicMonitor agent addresses here
 Allow from logicmonitor.com 192.168.10.10
</Location>

Where you set that configuration also changes depending on your Linux distribution.
/etc/apache2/mods-available/status.conf on Ubuntu/Debian
/etc/httpd/conf/httpd.conf on Redhat/CentOs
/etc/apache2/mod_status.conf on OpenSuse/SLES
Finally, restart apache using your OS startup script ( /etc/init.d/httpd restart or /etc/init.d/apache2 restart). Note that using the OS startup script is often necessary to allow the OS specific script files to assemble the final apache config. Sending apache signals, or using apache2ctl, does not do this.

Step 3. Watch the monitoring happen.

If you are using LogicMonitor’s Apache monitoring, then you’re done.  LogicMonitor will automatically detect the Apache web server, and apply appropriate monitoring and alerting, as well as alerting and graphing on the rest of the system, so you can correlate CPU, interface and disk load to Apache load.

One thing you may want to customize is your dashboards – add a widget that collects all Apache requests/second, from all hosts, or all production hosts, and aggregates them into a single graph.  Using LogicMonitor’s flexible graphs, the graph will automatically include new servers as you add them.

Apache Requests per second

Best practices for Apache server monitoring

Establish baselines

Establishing baselines for Apache performance metrics is crucial for effective network monitoring. Baselines help you understand what normal behavior looks like for your servers. By comparing real-time data against these baselines, you can quickly identify anomalies that may indicate issues such as increased traffic or hardware failures.

Automate alerts

Automating alerts is a key way to reduce manual monitoring overhead and ensure timely responses to potential problems. By configuring automated alerts for critical metrics such as CPU load, memory usage, and error rates, you can receive notifications as soon as thresholds are exceeded. This proactive approach allows you to address issues before they escalate, minimizing downtime and ensuring consistent server performance.

Regularly analyzing trends in your monitoring data helps with capacity planning and optimizing performance. Use historical data to identify patterns, such as increased traffic during certain times or resource usage spikes. This enables you to make informed decisions about scaling infrastructure, optimizing configurations, and planning for future growth. Trend analysis also allows you to fine-tune alert thresholds to reduce false positives and improve the accuracy of your monitoring system.

Tracing and automation

Implementing tracing and automation workflows enhances Apache server monitoring by automating alerts and analyzing trends. Tracing tracks request paths, offering insights into response times, errors, and dependencies to identify bottlenecks and optimize performance.

Automation workflows enable you to streamline repetitive tasks such as log analysis, performance testing, and restarts. By automating these processes, you can focus on more critical tasks while ensuring consistency and efficiency in your monitoring efforts. Version pinning specifies exact software versions, reducing compatibility issues and simplifying troubleshooting.

Ready to simplify your Apache monitoring?

Monitoring your Apache http servers is essential for maintaining optimal performance, ensuring availability, and preventing issues before they escalate. By understanding key metrics, integrating powerful monitoring tools, and setting up proactive alerts, you can stay ahead of server problems and ensure your infrastructure remains healthy and efficient.

If you’re looking to simplify your Apache monitoring, consider using LogicMonitor. LogicMonitor automates the setup, detection, and visualization of your Apache environment, making it easier to identify issues, set up alerts, and aggregate critical metrics. With LogicMonitor, you can save time, reduce manual effort, and ensure comprehensive coverage of your Apache infrastructure.

If you missed our recent advanced web seminar on  Best Practices for Monitoring an AWS Hosted Website, this post is for you. In the web seminar, we covered how to use LogicMonitor to monitor multiple layers of the infrastructure responsible for keeping a website up and running, and specifically how to set up this monitoring. Since this was an advanced topic, we included a fair amount of demonstration.

Specifically, we created an example website and a fairly simple AWS setup so that we could walkthrough everything we talked about in LogicMonitor. Keep in mind that almost everything we talked about can be applied to monitoring websites in general, and was not specific to AWS.

To sum up the key points, we recommend that you always monitor your website:

1. From the inside:

Monitoring your website from inside your network will enable you to pinpoint specific components that are causing problems when issues arise. Monitoring your website from the inside includes:

Because the LogicMonitor collector is within your network, it has access to the “behind the scenes” infrastructure components that your website is running on. Infrastructure is a general term, but what we mean here is that you should monitor things like servers and load balancers that you’re using to host your website. In our demonstration, we set up monitoring for our Amazon cloud infrastructure, which included two Elastic Compute Cloud (EC2) servers and one Elastic Load Balancer (ELB). This also allowed us to show off LogicMonitor’s new AWS monitoring functionality (currently in beta release.) LogicMonitor’s AWS monitoring uses the AWS software development kit (SDK) to get CloudWatch metrics and also computes metrics that CloudWatch doesn’t provide. This allows you to monitor your AWS cloud resources alongside your existing monitored architecture in LogicMonitor.

LogicMonitor has a webpage collection method that allows the collector to query data from any system using HTTP or HTTPS. The LogicMonitor default HTTP page datasource uses this collection method to check for load time and availability of a web page. But really, it is not sufficient to only check the availability a page, because you want to make sure that the correct content is loading. So you can actually customize the HTTP page datasource to look for specific content on a webpage. In our demonstration, we added data points that looked for a the presence of a specific string in our web pages.

It’s a good idea to monitor the application serving the web pages for your site because in a scenario where the web pages do stop working, the monitored data will let you know whether it’s a problem with the application itself or something else, like a problem with the website configuration file. In the webinar demonstration we set up Apache monitoring. The LogicMonitor Apache datasource uses the webpage collection method to accessing the server status page using HTTP, so you need to make sure this page is accessible.

2. From the outside:

You should monitor your website from outside your network to ensure that your website is accessible. Even if all of the equipment running your website is functioning perfectly, there are still multiple external factors that could potentially prevent outside users from being able to access it. A website that isn’t accessible to end users is not a very useful website. So to monitor the full picture, you need to have checks that come from outside your network. You can use LogicMonitor Services (aka SiteMonitor) to set up periodic checks from external locations to mimic the experience of a user accessing your site.

Keep in mind that you may have some overlap in the data you are monitoring for your website, but this redundancy can give you insight into what components aren’t working properly when something goes wrong, especially when you see inconsistencies between data for the same component monitored from different perspectives.

Below is a dashboard we put together  to show data for the monitoring we set up in our demonstration.

AWSDash
Sample Dashboard

Want to learn more? View the on demand Web Seminar: Best Practices for Monitoring an AWS Hosted Website.