Follow the steps for installing Applicare SingleAgent .
Step 1: To enable server-status and custom log modules in apache. Go to apache installed directory and edit the conf file.
Step 2: Check the below modules are enabled in the conf file. If it is not enable it by removing '#’ at the start of the line.
Some of the modules may not be present in the apache conf file by default. In that case add the below modules 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 3: The LogLevel should be warn. If the LogLevel is different then comment that LogLevel line.
Step 4: Create a new log folder inside the apache home directory.
Step 5: Add the below 5 lines at the end of the log_config_module and don't make any changes to the existing CustomLog path inside the log_config_module in the 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_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 custom name (without space) and double quotes should be there (Need to remove the angle brackets too). You can give any name in the <Apache_servername>. But it should be unique.
2. Replace <RotateLogPath> with your rotatelogs.exe path. (Need to remove the angle brackets too). By default it will be in the apache installed bin path <ApacheInstalledDir>/bin/rotatelogs.exe
3. Replace the "<ApacheInstalledDir>" with your apache installed path (Need to remove the angle brackets too).
4. Replace the <newlogfolder>with the folder name which you have created inside the apache installed directory (Need to remove the angle brackets too).
Step 6: Add the below modules at 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 there any syntax error in the configuration. If the output contains Syntax OK then the configuration is correct.
For httpd
httpd -t
Step 8: 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.
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> - Apache server running IP
<Apache_Port> - Apache server running port
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 running the startAgent.bat inside the <Agent_Home_Directory>.
Step 10: 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 11: Select the newly added agent and click the Edit button.
Step 12: Enable the "Add Apache Configuration" checkbox and Set the configuration as shown below. If the Apache is running in https select HTTPS in the Apache Protocol dropdown. Click the update button to save.
Note:
1. Other command to check the configuration and virtual hot details of apache server.
httpd -S and for version httpd -V
2. If the new log configuration is not taking effect check is there any custom configuration is called in the default configuration. Custom configuration can be called using the "IncludeOptional" keyword.
3. If the customer is wishing to only log the error logs to their existing log files. Add the below syntax to the end of their CustomLog.
"expr=%{REQUEST_STATUS} > 200"
Example:
CustomLog "logs/access.log" combined "expr=%{REQUEST_STATUS} > 200"
For Other Docs - Click here
Comments
0 comments
Article is closed for comments.