Follow the steps for installing Applicare SingleAgent.
Step 1: Enable the server-status and custom log modules in Apache by navigating to the Apache installation directory and editing the conf file.
Step 2: Verify that modules are enabled in the conf file. If they are not, enable them by removing '#’ at the beginning of the lines.
Some modules may not be include in the Apache conf file by default. In such cases, manually add the following modules below the Listen line in the 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 3: Set the LogLevel to warn. If it is set to a different value, comment out the existing LogLevel line.
Step 4: Create a new log folder within the apache home directory.
Step 5: Append the following five lines to the end of the log_config_module section in the conf file, leave the existing CustomLog path unchanged.
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_servername>"
CustomLog "|<RotateLogPath> <ApacheInstalledDir>/newlogfolder/apl_log 60" "%t %h %s %B %D %U :%{_ap_trace_id}i" env=!dontlog
1. Replace the <Apache_servername> with a custom name (without space) enclosed in double quotes (remove the angle brackets too). The name can be anything <Apache_servername>. But it must be unique.
2. Replace <RotateLogPath> with the path to your rotatelogs.exe file. (and remove the angle brackets too). By default, it is located at <ApacheInstalledDir>/bin/rotatelogs.exe within the Apache installation directory.
3. Replace the "<ApacheInstalledDir>" with the path to your Apache installation path (make sure remove the angle brackets too).
4. Replace the <newlogfolder>with the folder name of the folder you have inside the Apache installed directory (remove the angle brackets too).
Step 6: Append the following modules to the end of the conf file.
<IfModule mod_status.c>
<Location /server-status>
ProxyPass !
SetHandler server-status
Order allow,deny
Allow from all
</Location>
</IfModule>
Step 7: Check is the configuration of the any syntax errors. If the output displays Syntax OK then the configuration is correct.
For httpd
httpd -t
Step 8: Finally Restart Apache server.
After restarting the Apache server, enter the following URL in your browser. This will display some information about Apache server.
To check in browser:
<Apache_Protocol>://<Apache_IP>:<Apache_Port>/server-status?auto
Example: http://127.0.0.1:80/server-status?auto
To check using curl:
curl <Apache_Protocol>://<Apache_IP>:<Apache_Port>/server-status?auto
Example: curl http://127.0.0.1:80/server-status?auto
<Apache_Protocol>://<Apache_IP>:<Apache_Port>/server-status?auto
<Apache_Protocol> - http (or) https
<Apache_IP> - IP address of the Apache server
<Apache_Port> - Port number where the Apache server is running
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 9: Start the agent by executing the startAgent.bat within the <Agent_Home_Directory>.
Step 10: After the agent starts, it will be automatically registered to the Applicare controller. Log in to the Applicare console and navigate to the Overview menu.
Step 11: Select the newly added agent and click the Edit button.
Step 12: Check the "Add Apache Configuration" box and configure the setting as shown below. If Apache is running in HTTPS, select HTTPS from the Apache Protocol dropdown. Click the update button to save.
1. Use the following commands to check the configuration and virtual host details of apache server.
httpd -S and for version httpd -V
2. If the new log configuration isn't taking effect. Verify whether a custom configuration is being referenced in the default configuration. Custom configuration may be called using the "IncludeOptional" keyword.
3. If the customer wants to log only the error messages to their existing log files. Add the below syntax to the end of their CustomLog.
"expr=%{REQUEST_STATUS} > 200"
e.g.
CustomLog "logs/access.log" combined "expr=%{REQUEST_STATUS} > 200"
Comments
0 comments
Article is closed for comments.