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 RestartSec=30 [Install] WantedBy=multi-user.target
Reload systemd and start tomcat
sudo systemctl daemon-reload sudo systemctl start tomcat sudo systemctl enable tomcat
Tomcat logging configuration
CATALINA_HOME/conf/logging.properties
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler .handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler ############################################################ # Handler specific properties. # Describes specific configuration info for Handlers. ############################################################ 1catalina.org.apache.juli.AsyncFileHandler.level = ALL (in Test)/ INFO (for production systems) 1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. 1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90 1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8 1catalina.org.apache.juli.AsyncFileHandler.limit = 104857600 # 100 MB 1catalina.org.apache.juli.AsyncFileHandler.count = 10 # keep 10 rotated files
catalina.out size limit config (logrotate)
How to Control catalina.out Growth
✅ 1. Use logrotate (recommended on Linux systems)
Create a file /etc/logrotate.d/tomcat like this:
/opt/tomcat/logs/catalina.out { size 100M copytruncate rotate 7 compress missingok notifempty }
to test sudo logrotate -f /etc/logrotate.d/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/
Setting up a vault for File Management
ZFlow supports File Management as part of workflows, part attachments, and other files related to other objects. Files are managed in vault(s). The first 2 steps below assume that you have sudo privileges.
- Create a directory (example: /zflowfilevault)
- Give ownership of the directory to tomcat user
- sudo chown -R tomcat:tomcat /zflowfilevault
- Configure the vault in ZFlow
ZFlow Healthcheck
ZFlow package includes a healthcheck script that can be used to monitor health of ZFlow environment and automatically restart tomcat in cases of issues. Following
- make zflow-healthcheck executable
- update path to zflow-healthcheck in the script
- add entry in crontab with appropriate parameters