vFunction Agent - Tomcat - Linux
Install vFunction agent for a Java application running in Tomcat on Linux
-
Make sure your application is running correctly on the Linux Machine (run some tests)
-
Su - or login to the username running the tomcat process. To discover which user is running tomcat do:
ps aux | grep tomcat
then su to this username e.g.
su - tomcatuser
-
Download and copy the sudoless vFunction package to the Linux machine
a. If you have access to the vFunction portal:
- Login to the portal - Go to vFunction Installation Physical Files from the Dashboard - Go to the Controller Folder and the version subfolder (e.g. 4.0) - Next to the sudoless file (e.g. vfunction-sudo-less-installation.v4.0.1603.tgz) click on the three dots menu to the right and download the file - Copy the file to the Linux machine and move it to the folder under which you’d like to install vFunction (e.g. /home/tomcatuser)
b. Alternatively, ask your vFunction contact for the public link of the sudoless installation package and download it to your Linux machine. If you have access to the internet you can use wget or curl to download the package:
Example:
curl https://portal.vfunction.com/file/fe09339e19e/vfunction-controller-sudo-less-installation.v4.0.1603.tgz --output vfunction-sudoloess-controller.tgz
-
Extract the content of the installation package in the folder you want to install the agent (we will call this folder installation folder), this will create a subfolder called vfunction under the installation folder, which will contain all the installation files
example:
tar zxvf vfunction-sudoloess-controller.tgz
-
Click here to download a script (vfagentenv.sh) that sets the environment variables.
-
Copy vfagentenv.sh file to the installation folder in Linux machine (the parent folder of the vfunction folder). Then edit the file and set the values based on the comments in this script.
-
Apply the environment variables by doing:
source vfagentenv.sh
-
Run the agent installation from the installation folder:
bash ./vfunction/opt/vfunction/controller-installation/install.sh -i default-java
At the end of the installation you should see an output like:
You can now configure your java application to use vFunction's agent. Please look under /home/tomcatuser/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vmargs-examples/tomcat for an example on how to set the JVM args.
-
To apply the environment Java options variables you can simply “source” the file:
Example:
source /home/tomcatuser/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vmargs-examples/tomcat
Or you can add the above source command to your tomcat startup.sh to ensure the env gets applied.
-
Restart tomcat. You should see the agent running in the application in the vFunction server Web UI, in the select controllers page in the learning tab.