- 08 Sep 2023
- 2 Minutes to read
- Print
- DarkLight
- PDF
WildFly
- Updated on 08 Sep 2023
- 2 Minutes to read
- Print
- DarkLight
- PDF
Variables %WildFly_HOME% and $WildFly_HOME used throughout this article refer to the root directory where WildFly Application Server is installed in Windows and Linux operating systems respectively. Some sample values are provided below:
- %WildFly_HOME% - D:\wildfly-21.0.1.Final
- $WildFly_HOME - /opt/wildfly-21.0.1.Final
Windows
Auto Instrumentation
This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation
- Application Deployment Folder
- Log in to the Virtual Machine where WildFly is installed
- Utilize the below path as Application Deployment Folder
%WildFly_HOME%\standalone\deployments - Example: D:\wildfly-21.0.1.Final\standalone\deployments
- Startup Script File Path
- Provide the below path as Startup Script File Path
%WildFly_HOME%\bin\standalone.conf.bat OR
%WildFly_HOME%\bin\domain.conf.bat - Example: D:\wildfly-21.0.1.Final\bin\standalone.conf.bat
- Provide the below path as Startup Script File Path
Manual Instrumentation
This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below
Method 1:
- Shut down WildFly Server (if it is running)
- Add the content below to file standalone.conf.bat in the directory %WildFly_HOME%/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
@echo off ECHO.%JAVA_TOOL_OPTIONS%| FIND /I "instrumentation.jar">Nul || ( set JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS% -javaagent:"%VSP_HOME_WEB_MEM%"\iae-java\instrumentation.jar -Dvirsec_appcontextpath=<AppCollectiveID>
- Save the modified file standalone.conf.bat
- Start the WildFly Server
Method 2:
This method can be used for VSP instrumentation in Domain Mode deployment
- Log in to Virtual Machine where WildFly is installed
- Stop the WildFly service if it is running
- Modify the file %WildFly_HOME%\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented. In the below example, arguments are configured for JVM “server-one”
Before Change:
After change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section<servers> <server name="server-one" group="main-server-group"/> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
<servers> <server name="server-one" group="main-server-group"/> <jvm name="default"> <jvm-options> <option value="-javaagent:c:\PROGRA~2\Virsec\virsec-web-mem\iae-java\instrumentation.jar"/> <option value="-Dvirsec_appcontextpath="/> <option value="-DVSP_HOME_WEB_MEM=c:\PROGRA~2\Virsec\virsec-web-mem\"/> jvm-options> jvm> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> server> servers>
- Start the WildFly service
- Application Deployment Folder
- Log in to the Virtual Machine where WildFly is installed
- Utilize the below path as Application Deployment Folder
%WildFly_HOME%\domain - Example: D:\wildfly-21.0.1.Final\domain
- Startup Script File Path
- As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS
Linux
Auto Instrumentation
This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation
- Application Deployment Folder
- Log in to the Virtual Machine where WildFly is installed
- Utilize the below path as Application Deployment Folder
$WildFly_HOME/standalone/deployments - Example: /opt/wildfly-21.0.1.Final/standalone/deployments
- Startup Script File Path
- Provide the below path as Startup Script File Path
$WildFly_HOME/bin/standalone.conf - Example: /opt/wildfly-21.0.1.Final/bin/standalone.conf
- Provide the below path as Startup Script File Path
Manual Instrumentation
This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below
Method 1:
- Shut down WildFly Server (if it is running)
- Add the content below to file standalone.conf in the directory $WildFly_HOME/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration sectionShell
export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar -DVSP_HOME_WEB_MEM=/opt/virsec-web-mem -Dvirsec_appcontextpath="
- Save the modified file standalone.conf
- Start the WildFly Server
Method 2:
This method can be used for VSP instrumentation in Domain Mode deployment
- Log in to Virtual Machine where WildFly is installed
- Stop the Wildfly service if it is running
- Modify the file $WildFly_HOME\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented
In this example, arguments are configured for JVM “server-one”
Before Change:
After Change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section<servers> <server name="server-one" group="main-server-group"/> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
<servers> <server name="server-one" group="main-server-group"/> <jvm name="default"> <jvm-options> <option value="-javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar"/> <option value="-Dvirsec_appcontextpath=<AppCollectiveID>"/> <option value="-DVSP_HOME_WEB_MEM=/opt/virsec-web-mem"/> </jvm-options> </jvm> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
- Start the WildFly instance using the below command:
$WildFly_HOME/bin/standalone.sh
- Application Deployment Folder
- Log in to the Virtual Machine where WildFly is installed
- Utilize the below path as Application Deployment Folder
$WildFly_HOME/domain - Example: /opt/wildfly-21.0.1.Final/domain
- Startup Script File Path
- As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS