February was the birthday of one of the most important Free&Open Source projects: the Apache HTTP Server (“httpd”), very often simply called Apache, or Apache webserver. The project was started 1995, and since April 1996 has become the most popular webserver on the Internet (Currently, according to NetCraft around 60-65% of all webservers use Apache).
This remarkable growth was possible, because, on the one hand, Apache has an amazing set of simple yet advanced features. In addition, it is easy to administrate. Thanks to its modular design, Apache is extremely flexible and can be configure to be very efficient. It is a free and open project with a big, healthy and thriving community devoted to it. The documentation is great, and support is easy to find on various levels (from big enterprise organizations to teenagers and backyard specialists).
Starting your adventure with Apache is very easy. The number of articles on Apache configuration and installation you can find on the Internet is amazing. The obvious starting point is official documentation. But this blog can be a great source of advice, too. You might want to check the following articles: 25 Apache Performance Tuning Tips, Basic Apache and MySQL Performance Tuning: Part1: Apache, LAMP Security: 21 Tips for Apache. Installation also shouldn’t be a problem for anyone. For Linux (or BSD), Apache is just a package you can install with one command/click, for example, aptitude install apache for Ubuntu or Debian. If you would like to try Apache on Windows, Apache Foundation provides MSI builds on its download page.
Apache is only a tool that helps you to share a product with customers. Webserver should be invisible to your customers, and it should be fast and reliable. These two things can be tested by standard Monitis tools. Please visit the Monitis Portal to see available tools. Make sure you check out Page Test and Website Uptime Monitoring Service.
Those tools are great, but they measure a full customer experience, which might be affected by things not related to Apache (e.g. a slow network). Therefore, you need additional internal tests. Lots of very useful data are provided by ‘mod_status’, especially if you enable ExtendendStatus. From the “server-status” page, you can learn:
- server lifetime (with start/restart time) and the total number of accesses as well as bytes sent,
- information about current hosts and requests being processed,
- average values of requests and bytes served per second as well as number of bytes served by requests,
- the number of busy and idling workers,
- a status of each worker with number of served request bytes,
- CPU usage of each worker and Apache in total.
You should keep an eye on all of the above metrics. For standard monitoring, the most important are average values, total CPU usage and number of busy and idling workers. Of course these numbers may vary a lot due to the day, month or even year. These also can be affected by market changes (e.g. a successful advertisement campaign). Therefore you should have good visibility of longer terms trends. For example, the values of requests may vary 100 times during a day, but cannot differ more than 10% between any two Monday afternoons. It’s very hard to set up alerts for such a situation. So, having good graphs is essential.
Other data can be more useful during debugging. For example, if CPU usage is higher, it might be because of a higher work load. You might want to check changes in provided (virtual) hosts.
There is also information you can get by parsing the Apache log. Good examples are counters of different HTTP status types responses. An Increase of 40x or 50x would be a clear message that your system is not healthy and needs some checking. Another parameter to measure is the number of different types of requests. Rather than total number of requests or responses, you should monitor average value. A good starting point will be average per minute, but you might consider something longer, such as 5 minutes per period or something shorter, for example, 10 seconds.
Above, I mentioned some standard Monitis tools that would be helpful to monitor Apache (as well as any other webserver). Thanks to powerful API and custom monitoring, you can easily add monitoring values provided by Apache ‘status mod’. You only need to follow the Integrate Apache Monitoring into Monitis.com article from our blog. If you would like to extend your monitoring by measurement based on log parsing, check out another article on our blog, Apache & MonitisM3 the Perfect Match.
Obviously you should also pay attention to system-wide metrics, memory usage, general load, network statics (i.e. bytes send/received). Monitis provides very flexible system level monitoring for Linux and other OSs.
Learn more about Apache server at our Apache web server section.