WildFly
  • 08 Sep 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

WildFly

  • Dark
    Light
  • PDF

Article summary

About this Article
This article provides VSP application instrumentation steps for WildFly application server and provides the steps to determine the values of aeployment folder and start-up script path required during application configuration on CMS.


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

  1. Application Deployment Folder
    1. Log in to the Virtual Machine where WildFly is installed
    2. Utilize the below path as Application Deployment Folder
      %WildFly_HOME%\standalone\deployments
    3. Example: D:\wildfly-21.0.1.Final\standalone\deployments
  2. Startup Script File Path 
    1. Provide the below path as Startup Script File Path
      %WildFly_HOME%\bin\standalone.conf.bat OR
      %WildFly_HOME%\bin\domain.conf.bat
    2. Example: D:\wildfly-21.0.1.Final\bin\standalone.conf.bat


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:

  1. Shut down WildFly Server (if it is running)
  2. 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>
    
  3. Save the modified file standalone.conf.bat
  4. Start the WildFly Server

Method 2:

This method can be used for VSP instrumentation in Domain Mode deployment

  1. Log in to Virtual Machine where WildFly is installed
  2. Stop the WildFly service if it is running
  3. 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:
    <servers>
        <server name="server-one" group="main-server-group"/>
        <server name="server-two" group="other-server-group">                
      <socket-bindings port-offset="150"/>
        </server>
    </servers>
    
    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"/>
            <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>
    
  4. Start the WildFly service
  5. Application Deployment Folder
    1. Log in to the Virtual Machine where WildFly is installed
    2. Utilize the below path as Application Deployment Folder
      %WildFly_HOME%\domain
    3. Example: D:\wildfly-21.0.1.Final\domain
  6. Startup Script File Path
    1. 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

  1. Application Deployment Folder
    1. Log in to the Virtual Machine where WildFly is installed
    2. Utilize the below path as Application Deployment Folder
      $WildFly_HOME/standalone/deployments
    3. Example: /opt/wildfly-21.0.1.Final/standalone/deployments
  2. Startup Script File Path 
    1. Provide the below path as Startup Script File Path
      $WildFly_HOME/bin/standalone.conf
    2. Example: /opt/wildfly-21.0.1.Final/bin/standalone.conf


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:

  1. Shut down WildFly Server (if it is running)
  2. 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 section
    Shell
    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="
    
  3. Save the modified file standalone.conf
  4. Start the WildFly Server

Method 2:

This method can be used for VSP instrumentation in Domain Mode deployment

  1. Log in to Virtual Machine where WildFly is installed
  2. Stop the Wildfly service if it is running
  3. 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:
    <servers>
        <server name="server-one" group="main-server-group"/>
        <server name="server-two" group="other-server-group">                
      <socket-bindings port-offset="150"/>
        </server>
    </servers>
    
    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"/>
            <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>
    
  4. Start the WildFly instance using the below command:
    $WildFly_HOME/bin/standalone.sh
  5. Application Deployment Folder
    1. Log in to the Virtual Machine where WildFly is installed
    2. Utilize the below path as Application Deployment Folder
      $WildFly_HOME/domain
    3. Example: /opt/wildfly-21.0.1.Final/domain
  6. Startup Script File Path
    1. 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

Was this article helpful?

What's Next