Step 1: Follow the steps for installing Applicare SingleAgent .
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 2: 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
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>
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
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
5. Check setenvif_module is enabled, if not enable it by just removing '#’ before the
LoadModule setenvif_module modules/mod_setenvif.so
6. Check headers_module is enabled, if not enable it by just removing '#’ before the
LoadModule headers_module modules/mod_headers.so
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"
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
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:
Linux :
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"
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
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 :
Linux :
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
Step 3: Start the agent by running the startAgent.bat (Administrator mode for windows) and startAgent.sh (sudo for linux) inside the ApplicareSingleAgent.zip extracted directory.
Step 4: Once the agent is started, Agent will be automatically added to the Applicare controller. Login into the Applicare console and go to the Overview menu.
Step 5: Select the newly added agent and click the Edit button.
Step 6: Enable the "Add Apache Configuration" checkbox and Set the configuration as shown below. Click the update button to save.
For Apache version 2.2
For Apache version 2.4 and above
Comments
0 comments
Article is closed for comments.