Apache
Apache is an open-source web server software that serves web pages to users over the internet. The Sematext Agent collects Apache metrics and logs, transmits them to Sematext Cloud; installing the agent takes less than 5 minutes.
Install Sematext Agent¶
-
Activate Apache
mod_status
module withsudo a2enmod status
and configure it instatus.conf
file, e.g. in/etc/apache2/mods-enabled/status.conf
:ExtendedStatus On <Location /server-status> SetHandler server-status </Location>
-
Create an Apache Logs or Monitoring App. This will let you install the agent and control access to your monitoring and logs data.
- Install the Sematext Agent according to the https://apps.sematext.com/ui/howto/Apache/overview displayed in the UI.
- After installing the agent, the Discovery tab shows all the Apache services identified on the host and you will start receiving metrics or logs from Apache services.
- If you've created an Apache Monitoring App and want to collect Apache logs as well, or vice versa, click on the Create Logs App button from the left menu panel. This will navigate you to the 'Create Logs App' (or Monitoring App) page, where you'll find all the discovered log sources from Apache services and manage log and metric shipping effortlessly.
Having both Apache Logs and Monitoring Apps lets you correlate performance metrics and logs, and accelerate troubleshooting using Split Screen for faster resolution. For example, if you see an increase in 4XX errors, monitoring can tell what's the impact on Apache's response times and CPU usage.
To explore logs and services across multiple hosts, navigate to Fleet & Discovery > Discovery > Services (or Sematext Cloud Europe). From there, you can create additional Apps or stream data to existing ones without requiring any additional installations.
Apache Metrics¶
Metric Name | Key | Agg | Type | Description |
---|---|---|---|---|
async closing | apache.connections.async.closing | Avg | Double | |
async writing | apache.connections.async.writing | Avg | Double | |
busy | apache.workers.busy | Avg | Double | |
total | apache.connections.total | Avg | Double | |
requests count | apache.requests.count | Sum | Long | |
idle | apache.workers.idle | Avg | Double | |
async keep alive | apache.connections.async.keepAlive | Avg | Double | |
keepalive | apache.workers.keepalive | Avg | Double | keepalive: Number of workers currently sending keepalive messages |
open | apache.workers.open | Avg | Double | open: Number of workers currently not busy with any process |
sending | apache.workers.sending | Avg | Double | sending: Number of workers currently sending a reply |
finishing | apache.workers.finishing | Avg | Double | finishing: Number of workers currently gracefully finishing connections |
reading | apache.workers.reading | Avg | Double | reading: Number of workers currently reading incoming requests |
closing | apache.workers.closing | Avg | Double | closing: Number of workers currently closing a connection |
idle cleanup | apache.workers.cleanup | Avg | Double | idle cleanup: Number of workers currently performing idle cleanup procedure |
starting | apache.workers.starting | Avg | Double | starting: Number of workers currently starting up a connection |
logging | apache.workers.logging | Avg | Double | logging: Number of workers currently busy updating log files |
waiting | apache.workers.waiting | Avg | Double | waiting: Number of workers currently waiting for a connection |
dns lookup | apache.workers.dns | Avg | Double | dnslookup: Number of workers currently requesting DNS lookup |
PHP-FPM Monitoring¶
PHP-FPM monitoring can be enabled along with Apache monitoring. See PHP-FPM for more details.
Apache Logs¶
Once data is in, you can explore it via the built-in reports:
Exploring logs¶
Once data is in, you can explore it using the built-in reports or create your own. For example, you can use the Users report to check on where the requests are coming from:
Other built-in reports include:
- Errors: Logs specifically about errors. You can see which status codes are returned and which errors are logged by your Apache server.
- HTTP: Logs about Apache access logs. Use this report to view any and all data about HTTP requests and responses.
- Sources: Logs about Apache source files. You can view where the logs are collected from and from where in the world users are accessing your Apache server.
Troubleshooting¶
If you have trouble sending logs, try out the latest version of Sematext Agent. Also, make sure Sematext Agent is configured to send logs to your Apache Logs App. If you're using Apache in a container, make sure to configure it to output logs to the stdout/stderr streams. Last, check the Log Agents panel for any errors, and refer to our Sematext Logs FAQ for useful tips.
If you are having issues with Sematext Monitoring, i.e. not seeing Apache metrics, see How do I create the diagnostics package.
For more troubleshooting information please look at Troubleshooting section.