# Apache Integration

If you're running an Apache web server, Xitoring can help you keep track of important performance metrics using mod_status. With Xitoring's easy-to-use interface, you can quickly enable mod_status and configure it to work with Xitoring, allowing you to monitor key metrics like request processing times and server uptime. This information is displayed in the Xitoring app, giving you insights into your server's performance and helping you identify potential issues before they become serious. With Xitoring's Apache monitoring, you can ensure that your website or web application is always performing at its best.

# Enable Apache Integration

Supported platforms

The following guide is working on **Linux** and **Windows servers** but some details could be quite different based on the OS version.

The following lines will walk you through enabling Apache integration on Xitoring based on your OS.

## on Debian-based OS

As Xitogent is using the `mod_status` module to get statistics about Apache on the user's server, we need to make sure that is enabled on your Apache with the following command:

```text
ls /etc/apache2/mods-enabled | grep status*
```

The output should look like below:

```text
status.conf
status.load
```

After that you need to change some configuration on `/etc/apache2/mods-enabled/status.conf` and make it like the below:

```text
<IfModule mod_status.c>

<Location /server-status>
                SetHandler server-status
                Require local

</Location>
        ExtendedStatus On
        # Default: Off
        # SeeRequestTail On

<IfModule mod_proxy.c>
                ProxyStatus On
        </IfModule>

</IfModule>
```

Now the statistics are available on `127.0.0.1/server-status`

## On RHEL-Based OS

As Xitogent is using `mod_status` module to get statistics about Apache on the user's server, we need to make sure that is enabled on your Apache with the following command:

```text
ls -al modules/ | grep status*
```

The output should be like the below:

```text
-rwxr-xr-x 1 root root  28448 Apr  6  2022 mod_status.so
```

After that, you need to add some configuration on `/etc/httpd/conf/httpd.conf`. Add the following lines to the `httpd.conf` file:

```text
<IfModule mod_status.c>
  ExtendedStatus On
  <Location /server-status>
    SetHandler server-status
    Require local
  </Location>
</IfModule>
```

Now the statistics are available on `127.0.0.1/server-status`

## On Windows Server

The path for the Apache configuration file on a Windows Server may vary depending on the installation directory and version of Apache being used. However, in most cases, the configuration file named `httpd.conf` is located in the `conf` directory within the Apache installation directory.

Here's an example of the default path for Apache configuration file on a Windows Server:

```text
C:\Program Files\Apache Group\Apache2\conf\httpd.conf
```

To check if `mod_status` is enabled on your Apache server running on a Windows server, open your Apache configuration file `httpd.conf` located in the `conf` directory of the Apache installation. You can use any text editor to open this file. Look for the line that loads the `mod_status` module. It should look like this:

```text
LoadModule status_module modules/mod_status.so
```

If this line is commented out with a # at the beginning of the line, then mod_status is not enabled. If the line is not commented out, then mod_status is enabled.

## Enable Apache integration on Xitogent

The final step is to call the Xitogent CLI and enable the Apache Integration:

```text
xitogent integrate
```

Select Apache from the list of available integrations, it will prompt you for the URL of the location where statistics is served which is `127.0.0.1/server-status` in our example.

and that's it the Apache integration is now enabled and the configuration file is created in the `/etc/xitogent/integrations/apache_integration.conf`.

# Create Triggers for Apache integration

You can create Triggers for Apache integration and define incidents for the following parameters:

```text
Load 1
Load 5
Load 15
Request per second
Bytes per second
Bytes per request
Duration per request
```
