Installing FlexDeploy with Tomcat
The FlexDeploy distribution for Tomcat includes the binaries for Tomcat, the FlexDeploy WAR, and the base configurations, leaving only a few simple steps to complete the install. The distribution contains the following components.
- A tomcat 9.0.34 server with required libraries, and base configurations
- The FlexDeploy WAR
- The FlexDeploy database installation scripts
- The FlexDeploy database migration scripts (for upgrading an existing FlexDeploy Tomcat installation)
- The FlexDeploy plugins
Requirements
- 8GB of RAM
- 1 CPU
- We recommend approximately 125GB total disk space should be sufficient for application tier. See FlexDeploy System Requirements, which explains requirements for application and database tier.
- 64 bit Java 8 JDK.
There are several JDK options available when installing FlexDeploy. The main requirement is that the version of Java used is version 8. if your Linux distribution includes a build of OpenJDK 8 you can use that version.
- Amazon Corretto - Amazon's build of OpenJDK with security updates https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
- OpenJDK - https://adoptopenjdk.net/releases.html
- Oracle JDK - Oracle's build for those who are licensed http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- If you have not created FlexDeploy Working Directory and Artifact Repository folders, we will create in steps below. (See Create Folders for FlexDeploy Server)
- See Installation Instructions - Database Tier for requirements on Database tier.
- Optional Requirements
- Consider Java Cryptography Extension (JCE) unlimited strength policy files to avoid SSH issues when using strong ciphers. This is not necessary for newer JDK versions, if you see limited and unlimited folders under jre/lib/security/policy, then your JDK is generally setup for it.
- If you are using Git repository for source code, please install Git client on FlexDeploy server as well as some development servers. See Git Plugin Guide.
- If you are planning to use JDeveloper plugin to build ADF/Java applications, consider additional server requirements. See Oracle JDeveloper Plugin Guide.
- To enable https or HSTS, see Related Topics at the end of this document.
Installation Instructions
Adjust for Windows path if you are installing on Windows platform.
Step 1. Ensure Java 8 is installed on the server.
In this example, JAVA_HOME is /u01/java/jdk1.8.0_171 but it can be anything you want. If default java is not version 8, then we will need to adjust for it during Step 7 later.
Step 2. Extract the zip file in the desired location (referred to as "FlexDeploy Home" in this document). See example below, where zip was extracted in /u01/flexdeploy folder.
We recommend use of folder structure without any space in name.
Here is how it will look like after unzip.
Step 3. Setup the database for FlexDeploy, if you not already done so.
Step 4. Modify Tomcat configuration file (context.xml) for database connectivity depending on your database type.
- Replace the contents of context.xml with the contents the context-<type>.xml if using PostgreSQL. The default context.xml file included is for Oracle database.
- Replace URL and Password with the actual values.
File - <FlexDeploy Home>/apache-tomcat-flexdeploy/conf/context.xml
Example JDBC URL (CONNECT_STRING)
- Oracle
- The JDBC short format of host:sid:port should not be used. URL must be in the format listed below as we are recommending user of UCP based connection pooling.
- Example -
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=**HOSTNAME**)(PORT=**PORT**)))(CONNECT_DATA=(SERVICE_NAME=**SERVICE_NAME**)))
- If RAC is used for the database, multiple nodes can be listed in the address list of the URL or it can point to the scan listener for the cluster. See below sample URL for a RAC implementation that has a primary and secondary scan listener connecting to to a service name GOLD-CLOUD. This includes connection timeout, retry, and retry delay settings.
- Example -
jdbc:oracle:thin:@(DESCRIPTION = CONNECT_TIMEOUT=120) (RETRY_COUNT=20) (RETRY_DELAY=3) (TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=primary-scan) (PORT=1521))) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=secondary-scan) (PORT=1521))) (CONNECT_DATA=(SERVICE_NAME = gold-cloud)))
- Example -
- For more information about using UCP please check here.
- The JDBC short format of host:sid:port should not be used. URL must be in the format listed below as we are recommending user of UCP based connection pooling.
- PostgreSQL
- Syntax - jdbc:postgresql://hostname:port/flexdeploy
- Example -
jdbc:postgresql://dkrlp01:5432/flexdeploy
- If you are using database name other than flexdeploy, then update URL accordingly.
Connecting to Oracle Autonomous Database
You will need client credential zip file (wallet) to connect with Oracle Autonomous Database on Oracle cloud. You can download wallet zip file from Oracle Cloud, you will need admin userid and password to perform this download.See Download Client Credentials (Wallets) for more details on how to download wallet file.
You must make sure that only authorized users have access to these wallet files. Unzip the client credentials zip file (wallet_databasename.zip) on endpoint where it will be used, which most likely will be FlexDeploy server as we generally use localhost endpoint for JDBC. For example, /home/flexdeploy/.wallets/<wallet_databasename> is folder where specific wallet file was unzipped. Make sure to secure this folder to FlexDeploy and/or Endpoint user, so that it is not readable by all users.
- Database URL Syntax : jdbc:oracle:thin:@service_high?TNS_ADMIN=/home/flexdeploy/.wallets/<wallet_databasename>
- service_high is one of the entries in the tnsnames.ora file where client credentials zip file was unzipped. See Predefined Database Service Names for Autonomous Database for details on services.
- TNS_ADMIN value in URL points to the location of the unzipped client credentials zip file.
- Database URL Long Connection String Format Syntax : jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<hostname>))(connect_data=(service_name=<serice_name>))(security=(ssl_server_cert_dn="CN=<hostname>,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
- Examples for the same can be found here
<Resource name="jdbc/flexdbDS" auth="Container" type="oracle.ucp.jdbc.PoolDataSource" factory="oracle.ucp.jdbc.PoolDataSourceImpl" connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource" minPoolSize="0" maxPoolSize="100" initialPoolSize="0" autoCommit="false" inactiveConnectionTimeout="300" url="**CONNECT_STRING**" user="fd_admin" password="**FD_ADMIN_PASSWORD**" fastConnectionFailoverEnabled="true" validationQuery="select 1 from dual" testOnBorrow="true" useLocalSessionState="true" defaultAutoCommit="false"/>
<Resource name="jdbc/flexdbDS" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" driverClassName="org.postgresql.Driver" url="**CONNECT_STRING**" username="fd_admin" password="**FD_ADMIN_PASSWORD**" maxTotal="100" maxIdle="20" validationQuery="select 1" testOnBorrow="true" defaultTransactionIsolation="READ_COMMITTED" useLocalSessionState="true" defaultAutoCommit="false"/>
Step 5. (Optional) Modify Tomcat server.xml for port if necessary.
File - <FlexDeploy Home>/apache-tomcat-flexdeploy/conf/server.xml
- By default, the Tomcat server is configured to run on port 8000. If this port is in use, change to some other unused port. Search for <Connector port="8000" protocol="HTTP/1.1" if you want to change it.
- There are other ports referenced in the server.xml file as well. If the logs contain a port in use error, you can find the open ports on your machine and then search this file for ports that you find are in use and change them.
Step 6. (Optional) Modify Tomcat Environment script (setenvoverride.sh or setenvoverride.bat) for FlexDeploy server side directories.
If you are setting up FlexDeploy for Trial purposes, it is good idea to leave directories as default, but if you are setting up FlexDeploy for production use, then we recommend to modify to use directory structure outside of FlexDeploy installation.
For previous FlexDeploy versions, these changes were directly done in setenv.sh or setenv.bat files.
File - <FlexDeploy Home>/apache-tomcat-flexdeploy/bin/setenvoverride.sh (setenvoverride.bat on windows)
- Configure variable FD_APPLICATION_DIRECTORY with directory to use as the FlexDeploy working directory (See Create Folders for FlexDeploy Server - FlexDeploy Working Directory)
- Configure variable FD_REPOSITORY_DIRECTORY with the directory to host the FlexDeploy artifact repository (See Create Folders for FlexDeploy Server - FlexDeploy Artifact Repository)
Below are default artifact and working directories created under FlexDeploy Home when you extracted zip file. If you want to use different directories then modify setenvoverride.sh or setenvoverride.bat file, otherwise skip this step.
Default setenvoverride.sh is shown below.
Here is example of setenvoverride.sh which is modified to use non-default folders.
Step 7. (Optional) Modify Tomcat Environment script (setenvoverride.sh or setenvoverride.bat) for JAVA_HOME.
File - <FlexDeploy Home>/apache-tomcat-flexdeploy/bin/setenvoverride.sh (setenvoverride.bat on windows)
If JAVA_HOME is already set in your environment, you can skip this step.
Unix Example - JAVA_HOME=/u01/java/jdk1.8.0_121
Windows Example - set JAVA_HOME=c:/installs/Java/jdk1.8.0_121
If you were also setting JAVA_HOME, this file would look like this.
Step 8. (Only if using Oracle Database)
- Download the latest Oracle JDBC driver from https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html. Click on the driver link matching your Oracle database version, and download the driver compatible with JDK8. For example,
ojdbc8-full.tar.gz
.
Be sure to download the JDBC driver matching your Oracle Database version and one which is compiled and compatible with JDK8. If you download the driver which is compiled with a newer JDK you will get errors on server startup similar to the following:
Caused by: java.lang.UnsupportedClassVersionError: oracle/jdbc/OracleClob has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
- Remove ojdbc jar files like ojdbc*.jar or ojdbc*dms.jar from <FlexDeploy Home>/apache-tomcat-flexdeploy/lib.
Copy all jar files (for example, ojdbc8.jar, ons.jar, ucp.jar and other jars) from downloaded archive ojdbc8-full.tar.gz to <FlexDeploy Home>/apache-tomcat-flexdeploy/libext.
This has changed with FlexDeploy 5.6.0.1. Please put any extra libraries required inside of <FlexDeploy Home>/apache-tomcat-flexdeploy/libext not <FlexDeploy Home>/apache-tomcat-flexdeploy/lib. You will need to create this directory.
- UCP is now required for Oracle Database connections. See Implementing UCP connections with Tomcat and Oracle for more info.
Step 9. (Linux only) - set the shell scripts executable with this command.
chmod +x <FlexDeploy Home>/apache-tomcat-flexdeploy/bin/*.sh chmod +x <FlexDeploy Home>/*.sh
Step 10. Skip this step if you did not modify setenv.sh or setenv.bat to use non-default server side directories in Step 6.
If you are using non-default server side directories, then move all the jar files from <FlexDeploy Home>/application/plugins to FLEXDEPLOY_WORKING_DIR/plugins. At startup, FlexDeploy will load all the plugins.
Step 11. Start tomcat by running the following script.
File - <FlexDeploy Home>/StartFlexDeploy.sh(you can also use startup.sh or startup.bat scripts). If you want to use Windows service, see Install Windows Service for FlexDeploy Tomcat Server.
Note for Oracle XE Database
After starting your server, check the <FlexDeploy Home>/apache-tomcat-flexdeploy/logs/flexdeploy.0.log file for the following error message:
- ORA-12519, TNS:no appropriate service handler found
If present, increase the number of processes for the database
- Using SQLPlus update processes setting.
- alter system set processes=200 scope=spfile;
- Stop Tomcat
- Restart the XE Database
- Start Tomcat
Step 12. Launch FlexDeploy in your browser.
- http://hostname:8000/flexdeploy
- Update hostname in URL to indicate host where FlexDeploy is installed.
- Update port if you had modified server.xml for different port number.
- You will need to complete Initial Registration process, where you will create admin user for login.
Step 13. Go to Administration - Plugins on FlexDeploy. Verify that Plugins are loaded. You should not see any files remaining in FLEXDEPLOY_WORKING_DIR/plugins folder after few minutes.
Step 14. Now that you have installed FlexDeploy, let's get start with configuration. You can do this in matter of minutes by using Blueprints concept, which is very simple configuration wizard for most common usecases.
Related Topics
- style