Installing and Running ZFlow on RHEL

Below are the steps for installing and running ZFlow on RHEL. We are assuming that you have possession of an instance with RHEL 9.X

Installing Java

You can install java (OpenJDK 17) using the following command.

sudo dnf install java-17-openjdk-devel -y

Check java version with the following command

java -version

 

Installing Tomcat

Create a group named tomcat

sudo groupadd tomcat

 

Create the tomcat user in tomcat group

sudo useradd -r -m -U -d /opt/tomcat -s /bin/false -g tomcat tomcat

 

Download tomcat distribution from apache

cd /tmp
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85.tar.gz

 

Extract and move it to /opt/tomcat

sudo mkdir /opt/tomcat
sudo tar -xvzf apache-tomcat-9.0.85.tar.gz -C /opt/tomcat --strip-components=1

 

Create tomcat service

Create a file tomcat.service (you can use nano or vi)

vi /etc/systemd/system/tomcat.service

Copy the following text in the tomcat.service file and save

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_OPTS=-Xms512M -Xmx2048M -server -XX:+UseParallelGC"
Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

Restart=on-failure

[Install]
WantedBy=multi-user.target

 

Reload systemd and start tomcat

sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl enable tomcat

 

 

 

Database for ZFlow

The best option for setting up a database for ZFlow is to use a service like AWS RDS for MySQL. ZFlow requires an empty database with complete read/write access (given to the database user) to the database to install application-specific tables.

If you use AWS RDS for MySQL as the database, the database address will be similar to the one below. zflowdb is the database created in the database server (awsrdsdbservername.rds.amazonaws.com) for ZFlow.

awsrdsdbservername.rds.amazonaws.com:3306/zflowdb

Note the database address, database username, and password as you need them when installing ZFlow.

 

Installing ZFlow

You can download the ZFlow application tar or zip file from the ZFlow support site. You will need access via ssh or

Extract zflow archive

Get the URL to download zflow.tar and use wget to download the tar/zip file

cd /tmp

wget ...

Extract the tar file

tar -xvf zflow2502.tar

Unzip the zip file (you may have to install zip and unzip – sudo yum install -y zip unzip)

unzip zflow2502.zip

The distribution will be under the zflow directory

Move the zflow directory to the/opt/tomcat/webapps directory

mv zflow /opt/tomcat/webapps/

sds

Miscellaneous