Apache server 2.4 monitoring setup

Community post

Shared by the Applicare community. It has not been re-checked against Applicare 10.0, so confirm the steps in your environment or contact Support.

Apache server Monitoring with Applicare

Note: Some of the modules may not be present in the apache conf file by default. In that case add the module lines manually below the Apache Listen line in the apache conf file.

#Listen 12.34.56.78:80
Listen 80

LoadModule status_module modules/mod_status.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule headers_module modules/mod_headers.so

Step 1: To enable server-status and custom log modules in apache. Go to <ApacheHomeDir>/conf and edit httpd.conf file as below.

1. Check status_module is enabled, if not enable it by just removing '#’ before the

LoadModule status_module modules/mod_status.so

[Screenshot 1 is not available on this page.]

2. Search for <Location /server-status> and add the "Required or Order" commands inside the <Location /server-status> based on the Apache version. If the <Location /server-status> is there then add the below modules at the end of the conf file based on the apache versions.

For Apache 2.2

<IfModule mod_status.c> <Location /server-status> SetHandler server-status Order allow,deny Allow from all </Location> </IfModule>

For Apache 2.4

<IfModule mod_status.c> <Location /server-status> SetHandler server-status Require all granted </Location> </IfModule>

[Screenshot 2 is not available on this page.]

3. Check log_config_module is enabled, if not enable it by just removing '#’ before the

LoadModule log_config_module modules/mod_log_config.so

[Screenshot 3 is not available on this page.]

4. Check unique_id_module is enabled, if not enable it by just removing '#’ before the

LoadModule unique_id_module modules/mod_unique_id.so

[Screenshot 4 is not available on this page.]

5. Check setenvif_module is enabled, if not enable it by just removing '#’ before the

LoadModule setenvif_module modules/mod_setenvif.so

[Screenshot 5 is not available on this page.]

6. Check headers_module is enabled, if not enable it by just removing '#’ before the

LoadModule headers_module modules/mod_headers.so

[Screenshot 6 is not available on this page.]

For Apache version 2.2

7. Create a new log folder inside the apache home directory.

8. Add the below 4 lines inside the log_config_module and comment other ‘CustomLog's inside the log_config_module in the httpd.conf file.

SetEnvIfNoCase Request_URI "^/server-status/pingFromApplicare" dontlog

SetEnvIfNoCase Request_URI "^/applicare_agent/*" dontlog SetEnvIf _ap_trace_id ^[a-zA-Z0-9].* HAVE_AP_ID RequestHeader set _ap_trace_id "%{UNIQUE_ID}e" env=!HAVE_AP_ID RequestHeader set _ap_apache_id "Apache"

For Windows add the below line next to the RequestHeader set _ap_apache_id "Apache" line.

CustomLog "|<ApacheHomeDir>/bin/rotatelogs.exe <ApacheHomeDir>/newlogfolder/apl_log 60" "%t %h %s %B %D %U :%{_ap_trace_id}i" env=!dontlog

For Linux add the below line next to the RequestHeader set _ap_apache_id "Apache" line.

CustomLog "|<ApacheHomeDir>/bin/rotatelogs <ApacheHomeDir>/newlogfolder/apl_log 60" "%t %h %s %B %D %U :%{_ap_trace_id}i" env=!dontlog

Note:

1. Replace the "<ApacheHomeDir>" with your apache installed path (Need to remove the angle brackets also).

2. Replace the "Apache" with Apache servername (without space) and double quotes should be there. You can give any name in the Apache servername, But it should be unique.

3. Replace the newlogfolder with the folder name which you have created inside the apache home directory.

Windows:

[Screenshot 7 is not available on this page.]

Linux :

[Screenshot 8 is not available on this page.]

For Apache version 2.4 and above

7. Create a new log folder inside the apache home directory.

8. Add the below 4 lines inside the log_config_module and comment other ‘CustomLog's inside the log_config_module in the httpd.conf file.

SetEnvIfNoCase Request_URI "^/server-status/pingFromApplicare" dontlog

SetEnvIfNoCase Request_URI "^/applicare_agent/*" dontlog SetEnvIf _ap_trace_id ^[a-zA-Z0-9].* HAVE_AP_ID RequestHeader set _ap_trace_id "%{UNIQUE_ID}e" env=!HAVE_AP_ID RequestHeader set _ap_apache_id "Apache"

For Windows add the below line next to the RequestHeader set _ap_apache_id "Apache" line.

  • CustomLog "|<ApacheHomeDir>/bin/rotatelogs.exe -n 1440 <ApacheHomeDir>/newlogfolder/apl_log 60" "%t %h %s %B %D %U :%{_ap_trace_id}i" env=!dontlog

For Linux add the below line next to the to the RequestHeader set _ap_apache_id "Apache" line.

  • CustomLog "|<ApacheHomeDir>/bin/rotatelogs -n 1440 <ApacheHomeDir>/newlogfolder/apl_log 60" "%t %h %s %B %D %U :%{_ap_trace_id}i" env=!dontlog

Note:

1. Replace the "<ApacheHomeDir>" with your apache installed path (Need to remove the angle brackets also).

2. Replace the "Apache" with Apache servername (without space) and double quotes should be there. You can give any name in the Apache servername, But it should be unique.

3. Replace the newlogfolder with the folder name which you have created inside the apache home directory.

Windows :

[Screenshot 9 is not available on this page.]

Linux :

[Screenshot 10 is not available on this page.]

9. Finally Restart Apache server.

Note:

After restarting the apache server hit the below request in the browser url. It will display some information about apache server.

<Apache_Protocol>://<Apache_IP>:<Apache_Port>/server-status?auto

<Apache_Protocol> - http (or) https <Apache_IP> - Apache server running IP <Apache_Port> - Apache server running port

ServerVersion: Apache/2.4.37
ServerMPM: event
Server Built: Jan 27 2021 07:22:47
CurrentTime: Monday, 28-Jun-2021 18:11:40 EDT
RestartTime: Monday, 28-Jun-2021 18:08:24 EDT
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 195
ServerUptime: 3 minutes 15 seconds

Installing Applicare Stand-alone Agent Application

1. First, you will have to build the stand-alone collector. Once you install Applicare you can build

the stand-alone agent by running

<ApplicareServer Install Dir>/agent/Standalonecollector/build/ build_collector.bat/sh

[Screenshot 11 is not available on this page.]

This will create a new folder,

<Applicare Server Install Dir>/agent/Standalonecollector/Applicare

and,

<Applicare Install Dir>/agent/Standalonecollector/Applicare.jar

2. If you are going to deploy the agent in the new machine then copy the "Applicare" folder or "Applicare.jar " from the Applicare server machine to agent machine and extract in any directory.

[Screenshot 12 is not available on this page.]

Please make sure that on Linux environment you assign appropriate read/write permission to extracted/copied Applicare folder/jar. Additionally, run the following command from the extracted/copied folder to assign execute permission to all the .sh script files.

chmod +x *.sh

3. To start the agent application run, Applicare/server/bin/startup.bat/sh

4. Please note that the agent by default runs on port 9880. You can change the port number by modifying Applicare /server/conf/server.xml

[Screenshot 13 is not available on this page.]

5. Set "SERVER_NAME" and "JAVA_HOME" property in the agent "Catalina.bat/sh" file before starting the agent.

Go to the path Applicare/server/bin/catalina.bat/sh

Edit Catalina.bat/sh and set the "SERVER_NAME" &

"JAVA_HOME" and save the file.

SERVER_NAME - You can give any name without spaces.

JAVA_HOME - Java JDK path of the Agent machine.

Note: For every agent, the SERVER_NAME should be unique.

For Windows edit Catalina.bat file and save

[Screenshot 14 is not available on this page.]

For Linux edit**, Catalina.sh** file and save

[Screenshot 15 is not available on this page.]

Running Applicare server and Agent:- (Run as Administrator)

To start Applicare Server:

1. Go to the Aplicare server installed directory.

2. Open a command prompt in "Administrator mode".

  1. Go to the path <ApplicareServerHomeDir>/server/bin.

4. Execute the "startup.bat/sh" script file.

For Windows execute "startup.bat" and for Linux execute "startup.sh" script file.

[Screenshot 16 is not available on this page.]

[Screenshot 17 is not available on this page.]

To start Agent:

1. Go to the Aplicare Agent installed directory.

2. Open a command prompt in "Administrator mode".

  1. Go to the path <ApplicareAgentHomeDir>****/server/bin.

4. Execute the "startup.bat" script file.

[Screenshot 18 is not available on this page.]

[Screenshot 19 is not available on this page.]

Adding the Agent in Applicare server

1. Open the overview screen in the Applicare console and click the “Add server” button to add the Standalone agent.

For Apache version 2.2

[Screenshot 20 is not available on this page.]

For Apache version 2.4 and above

[Screenshot 21 is not available on this page.]

2. Add the App name to the Standalone agent.

[Screenshot 22 is not available on this page.]

Enterprise

[Screenshot 23 is not available on this page.]

Apache

[Screenshot 24 is not available on this page.]

HTTP

Log consolidated HTTP data

[Screenshot 25 is not available on this page.]

Errors

[Screenshot 26 is not available on this page.]

Business Transactions

Top Business Transactions

[Screenshot 27 is not available on this page.]

Adding URL as KBT

[Screenshot 28 is not available on this page.]

[Screenshot 29 is not available on this page.]

[Screenshot 30 is not available on this page.]

Key Business Transactions Load

[Screenshot 31 is not available on this page.]

Key Business Transactions Load Distributions

[Screenshot 32 is not available on this page.]

Transactions

[Screenshot 33 is not available on this page.]

Enabling Apache User Experience Analyzer

By enabling this each and every individual transaction will be logged into the database as a separate one. So a huge amount of data will be logged into the database.

Please follow the below steps to add Apache User Experience Analyzer

1. Go to Menu and select Configure Dynamic Instrumentation.

[Screenshot 34 is not available on this page.]

2. Select the server and add "End User Experience Profiling" aspect to that server.

[Screenshot 35 is not available on this page.]

3. In the next few minutes, you can see the data in "Apache User Experience Analyzer".

Dashboard

[Screenshot 36 is not available on this page.]

Transactions

[Screenshot 37 is not available on this page.]

To Restrict only specific URL's to be logged in Apache User Experience Analyzer screen

1. Go to User Experience --> Settings (icon) --> UEM URL Exclusion/Inclusion

[Screenshot 38 is not available on this page.]

2. Add the URL's in the UEM Include and Exclude

UEM Include & Exclude

If the UEM Include list is not empty then only the URL's specified in that list will be logged.

[Screenshot 39 is not available on this page.]

Click "OK"

[Screenshot 40 is not available on this page.]

Note: After applying the changes Standalone Agent restart is required. So please add all the needed URL's in UEM Include, Exclude and apply the change and restart the Standalone Agent.

OS

[Screenshot 41 is not available on this page.]

CPU Cores

[Screenshot 42 is not available on this page.]

Processes

[Screenshot 43 is not available on this page.]

Disk

[Screenshot 44 is not available on this page.]

Network Connections

[Screenshot 45 is not available on this page.]

Mbean Browser

[Screenshot 46 is not available on this page.]

Port Requirements:

Applicare controller IP -> Applicare Agent IP and Port (Default - 9880)

Applicare controller IP -> Apache IP and Port

Applicare Agent IP -> Applicare controller IP and Port (Default - 8880) and Applicare Database Ports (Defaults Derby - 1527, Mysql - 3306, Oracle - 1521)

Applicare Agent IP -> Apache IP and Port

Join the discussion

Comments, voting and following are kept by Zendesk and need a Help Center account. This button opens the original discussion there.

Opens Zendesk · needs internet and sign-in

Still stuck? Contact support