Configure Engagement Services - Tomcat_Server
Configure Engagement Services - Tomcat_Server
To configure Engagement Services on Tomcat server, follow these steps:
- Go to
<Tomcat Installation Directory>/bin -
Modify the
catalina.batfile with the following parameters:Parameters (for JVM) Required Description -Xmx2048m Yes Minimum Heap size: 2GB -Xms2048m Yes Maximum Heap size: 2GB -XX:MaxPermSize=512m Yes One-fourth of the main Heap memory assigned -XX:+UseConcMarkSweepGC Yes This is a recommended setting -XX:HeapDumpPath Optional This parameter is to get Heap Dump Path-Dvpns.configLocation Yes This is the directory where the configResource.properties,database.properties, andvmslog4j2. xmlfiles must be placed.For example, if the location is/data/vpns-config, then you must specify the property as -Dvpns.configLocation=/data/vpns-config-Dlog4j2.enableJndiJdbc=true Yes This parameter is to fix log4jvulnerabilityNote: -Dhibernate.dialect : This parameter mentioned in the above table is required only for Oracle database.
Example: This is a sample for above mentioned parameters.
set JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=256m -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/vpns/logs/heapdumps -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.Log4JLogger -Dfile.encoding=UTF8 -Dvpns.configLocation=/data/vpns-config/ -Dlog4j2.enableJndiJdbc=true"
-
Configure following jvm parameters:
-Xms2048m –Xmx2048m -Dvpns.configLocation=
-
Configure JRE Home. Example: Set
JRE_HOME=C:/Program Files/Java/jre1.8.0_221. - Save the configuration.
-
Configure the datasource.
Database
MySQL
- Copy
mysql-connector-x-8.x.x.jarto<Tomcat installation directory>/lib - Create the vpns.xml file in the
<User install directory>\apache-tomcat-9.x.x\conf\Catalina\localhostfolder. - In the vpns.xml file, add the following data source configurations:
<Resource name="jdbc/vpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://<host>:<port>/
<database>?autoReconnect=true&
useUnicode=yes&characterEncoding=UTF-8&cachePrepStmts=true&
cacheCallableStmts
=true&cacheServerConfiguration=true&useLocalSessionState
=true&elideSetAutoCommits
=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&
rewriteBatchedStatements=true&max_allowed_packet=104857600 "/>
- Replace the value given below in the above configuration.
| Configuration Value | Description |
|---|---|
| host | Database server IP/name |
| port | Database server port |
| username | Database user name |
| password | Database password |
| database | Database name |
Oracle
- Copy
ojdbc11.jarto<Tomcat installation directory>/lib - Create the vpns.xml file in the
<User install directory>\apache-tomcat-9.x.x\conf\Catalina\localhostfolder. - In the vpns.xml file, add the following data source configurations:
<Resource name="jdbc/vpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="30" minIdle="1" maxIdle="10" testWhileIdle="true"
maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="select 1 from dual" removeAbandoned="false"
removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@host:port:sid"/>
- Replace the value given below in the above configuration.
| Configuration Value | Description |
|---|---|
| host | Database server IP/name |
| port | Database server port |
| username | database user name |
| password | Database password |
| sid | Oracle service id/name |
SQLServer
- Copy
sqljdbc4-4.1.jarto<Tomcat installation directory>/lib - Create the vpns.xml file in the
<User install directory>\apache-tomcat-9.x.x\conf\Catalina\localhostfolder. - In the vpns.xml file, add the following data source configurations: ``` <Resource name="jdbc/vpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://host:port;databaseName=database;user=username; password=password;sendStringParametersAsUnicode=true;"/> ```
- Replace the value given below in the above configuration.
| Configuration Value | Description |
|---|---|
| host | Database server IP/name |
| port | Database server port |
| username | Database user name |
| password | Database password |
| database | Database name |
Deploy Engagement Services
-
To deploy Engagement Services .wars to Tomcat Server, copy and past the
vpns.warfile to the following location:<Tomcat installation directory>/webapps/ -
After you deploy Engagement Services, complete the Engagement Services setup and start the Tomcat Server.
Post Upgrade
To start Tomcat server, post upgrade follow these steps:
-
Clean up tomcat work directory.
<Tomcat installation directory>/work/Catalina/<host>/
-
Remove
vpnsfolder in the above path and re-start Tomcat service.