Installation - Java Linux Agent on a Tomcat Application Server



Tomcat Compatibility

vFunction supports Apache Tomcat version 6 and later.


Installation Wizard

To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as steps for deploying the vFunction Agent to your environment.

Please contact support@vfunction.com or your vFunction Contact(s) for the password to start using this Wizard.


Installation Steps

  1. Ensure Prerequisites are met
  2. Download the vFunction Sudoless Controller Installation TGZ
  3. SSH to the Linux VM as the user who runs the Application / Application Server
  4. Move the Installation TGZ to the location on the Linux VM where vFunction should run
  5. Extract the vFunction Installation Package
### Replace VERSION with the actual value
tar -xvzf vfunction-controller-sudo-less-installation.vVERSION.tgz
  1. Add Environment Variables for the vFunction Dynamic Agent
# See description in https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/java/linux
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_NAME="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_HOST="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_ORG_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_APP_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_CLIENT_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_CLIENT_SECRET="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_INSTANCE_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_AGENT_APPLICATION_SERVER="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_JAVA_AGENT_APPLICATION_JAVA_VERSION="CHANGE_ME"
  1. Run the installation script
### Replace the BASE_DIR with the actual value, such as /tmp/
bash BASE_DIR/vfunction/opt/vfunction/controller-installation/install.sh -i default-java
  1. Find and note the base path to your Tomcat Application Server
### This should return the location of the bin/setenv.sh which should be in the Tomcat Application Server's CATALINA_HOME
find / -name 'setenv.sh' -type f 2&>/dev/null
  1. Add the startup parameters to your Tomcat Application Server’s CATALINA_OPTS
### Replace the BASE_DIR and CATALINA_HOME below with the actual values
cat BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vmargs-examples/tomcat >> CATALINA_HOME/bin/setenv.sh
  1. Restart the Tomcat instance
  2. Confirm that the Application comes up and functions as expected
  3. If any issues arise:

Why use the CATALINA_OPTS instead of JAVA_OPTS?

The key difference between the JAVA_OPTS and CATALINA_OPTS is how widespread each environmental variable will be applied. Any change to the JAVA_OPTS will be applied to all the running Tomcat instances. Any change to the CATALINA_OPTS will be applied only to the single Tomcat instance. For vFunction, it is best to use the CATALINA_OPTS to apply the vFunction Agent only to the single Tomcat instance.