Oracle Tomcat

  1. Oracle Tomcat Online
  2. Oracle Toma
  3. Oracle Tomcat Ords
  4. Tomcat Remove Abandoned
  5. Oracle Tomcat Tutorial
  6. Oracle Tomcat Free
  7. Tomcat Oracle Wallet Configuration

Install and Configure Oracle APEX with ORDS and Apache Tomcat

(Optional) If you want @PreDestroy annotations to work without raising errors and use TomCat 7 or 8, you have to register a custom listener, which will take care of these Annotations, since Oracle tries to access the Session in PreDestroy, while Tomcat adheres to the stupid official standard and invalidated the session before calling PreDestroy: You will have to copy the following JAR-File (source included) to your shared-lib folder: adf-predestroy-helper.jar and register it in the WEBINF. If the Tomcat server is part of a cluster environment, configure the server for clustering as described in Section 4.2.8, 'Configuring a Tomcat Server for Clustering.' If the server will be running over SSL, configure the Tomcat server for SSL as described in Section 4.2.9, 'Configuring a Tomcat Server for SSL.' The minimum and maximum heap size can be set in Tomcat by adding the parameters: set CATALINAOPTS=%CATALINAOPTS% -Xms1024m -Xmx1024m. Oracle recommends setting the same value for the two arguments to minimize garbage collections. To view the available memory, you can inspect the MBean java.lang:type=Memory with the attribute HeapMemoryUsage.

Introduction:

In this post, we will discuss about the step by step procedure to install Oracle Application express 19.2 with ORDS and Apache Tomcat.

Customer who works with Apex deployed on PL/SQL gateway face challenges in case of performance (It consumes more load on the server). In order to increase the Application performance, Oracle recommends to use Apex with ORDS and Tomcat. Added the reference DOC id from Oracle Support at the end of the document. Let’s start with the Installation steps.

PART 1: Installation of Oracle Apex 19.2

  1. In our case the downloaded apex software (apex_19.2_en.zip) is present in the below location.

/home/oracle/devdoyensys

  1. Unzip apex software from the above location.

After the Unzip, a new folder will be created named as ‘apex‘. This folder contains all the sql scripts regarding apex operations.

[[email protected]]$ unzip apex_19.2_en.zip[[email protected]]$ ls -lrth

total 153M

drwxr-xr-x. 6 oracle oinstall 4.0K Nov 7 2019 apex

-rwxr-xr-x. 1 oracle oinstall 95M Oct 15 17:21 apex_19.2_en.zip

  1. From this location connect as sys user and create a Tablespace in database for storing Apex MetaData.

SQL> CREATE TABLESPACE APEX DATAFILE ‘/u01/app/oracle/oradata/DEV/apex01.dbf’ SIZE 1G;

Tablespace created.

  1. Start installation of Apex 19.2

Run the apexins.sql to install the Apex files into created APEX tablespace.

[[email protected] ~]$ cd devdoyensys/apex/[[email protected] apex]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 – Production on Thu Oct 15 17:50:33 2020

Version 19.8.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production

Version 19.8.0.0.0

SQL>@apexins.sql APEX APEX TEMP /i/

Thank you for installing Oracle Application Express 19.2.0.00.18

Oracle Application Express is installed in the APEX_190200 schema.

The structure of the link to the Application Express administration services is as follows:

Oracle tomcat download

http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql)

http://host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

http://host:port/apex/apex_admin (Oracle REST Data Services)

The structure of the link to the Application Express development interface is as follows:

http://host:port/pls/apex (Oracle HTTP Server with mod_plsql)

http://host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

http://host:port/apex (Oracle REST Data Services)

timing for: Phase 3 (Switch)

Elapsed: 00:00:09.92

timing for: Complete Installation

Elapsed: 00:10:49.83

PL/SQL procedure successfully completed.

1 row selected.

…null1.sql

  1. Configure database RESTful services.

Note: The passwords for the newly created users APEX_LISTENER and APEX_REST_PUBLIC_USER will be used later for the ORDS setup.

SQL>@apex_rest_config.sql

Enter a password for the APEX_LISTENER user [] Set your Password here

Enter a password for the APEX_REST_PUBLIC_USER user [] Set your Password here

  1. Login to DB assysdba to unlock the user account.

SQL> alter user APEX_LISTENER identified by Pwd#123 account unlock;

User altered.

SQL> alter user APEX_PUBLIC_USER identified by Pwd#123 account unlock;

User altered.

SQL> alter user APEX_REST_PUBLIC_USER identified by Pwd#123 account unlock;

User altered.

  1. Check whether http port is set as 0, if not setit is as mentioned below (the agenda is to launch the Apex using Tomcat Apache )

SQL> EXEC dbms_xdb.sethttpport(0);

PL/SQL procedure successfully completed.

PART 2: Installation of Tomcat & Java JDK

  1. In our case the downloaded Tomcat, Java jdk softwareis present in the below location.

cd /home/oracle/devdoyensys

  1. Extract the software setup as below from the above location.

After the extract, a new folder will be created in the name jdk-13.0.1and apache-tomcat-9.0.27

[[email protected]]$ tar -xvf jdk-13.0.1_linux-x64_bin.tar.gz[[email protected]]$ tar -xvf apache-tomcat-9.0.27.tar.gz[[email protected]]$ ls -lrth

total 343M

-rwxr-xr-x. 1 oracle oinstall 95M Oct 15 17:21 apex_19.2_en.zip

drwxr-xr-x. 6 oracle oinstall 4.0K Oct 15 17:52 apex

-rwxr-xr-x. 1 oracle oinstall 180M Oct 15 18:34 jdk-13.0.1_linux-x64_bin.tar.gz

-rwxr-xr-x. 1 oracle oinstall 11M Oct 15 18:35 apache-tomcat-9.0.27.tar.gz

drwxr-xr-x. 9 oracle oinstall 99 Oct 15 18:35 jdk-13.0.1

drwxr-xr-x. 9 oracle oinstall 4.0K Oct 15 18:36 apache-tomcat-9.0.27

  1. Make sure to set the following environment variable to start the tomcat application.

vitomcat.env

export JAVA_HOME=/home/oracle/devdoyensys/jdk-13.0.1

export CATALINA_HOME=/home/oracle/devdoyensys/apache-tomcat-9.0.27

export CATALINA_BASE=$CATALINA_HOME

Now source the env file

. tomcat.env

Check Startup and shutdown of the tomcat service from the following location

[[email protected] ~]$ cd $CATALINA_HOME[[email protected] apache-tomcat-9.0.27]$ cd bin/[[email protected] bin]$ sh startup.sh

Using CATALINA_BASE: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_HOME: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_TMPDIR: /home/oracle/devdoyensys/apache-tomcat-9.0.27/temp

Using JRE_HOME: /home/oracle/devdoyensys/jdk-13.0.1

Using CLASSPATH: /home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/bootstrap.jar:/home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/tomcat-juli.jar

Tomcat started.

If tomcat is installed correctly,you could be able to view this page in web browser after starting tomcat service.

[[email protected] bin]$ sh shutdown.sh

Using CATALINA_BASE: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_HOME: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_TMPDIR: /home/oracle/devdoyensys/apache-tomcat-9.0.27/temp

Using JRE_HOME: /home/oracle/devdoyensys/jdk-13.0.1

Using CLASSPATH: /home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/bootstrap.jar:/home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/tomcat-juli.jar

NOTE: Picked up JDK_JAVA_OPTIONS: –add-opens=java.base/java.lang=ALL-UNNAMED –add-opens=java.base/java.io=ALL-UNNAMED –add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

Note: Check the catalina log ($CATALINA_HOME/logs/catalina.out) for any issue.

  1. Specify as which user you need to access this application in following xml file.

cd /home/oracle/devdoyensys/apache-tomcat-9.0.27/conf

vi tomcat-users.xml

add below details

<role rolename=”manager-gui” />

<user username=”oracle” password=”oracle” roles=”manager-gui” />

PART 3: Install Oracle Rest Data service (ORDS)

  1. Create a separate directory for ORDS insllataion and then Unzip ORDS software as below in the following location.
[[email protected]]$ mkdir -p /home/oracle/devdoyensys/ords[[email protected]]$ unzip ords-19.1.0.092.1545.zip -d /home/oracle/devdoyensys/ords[[email protected]]$ cd ords/[[email protected]]$ ls -lrth

Oracle Tomcat Online

total 58M

drwxr-xr-x. 2 oracle oinstall 35 May 31 2018 params

drwxr-xr-x. 6 oracle oinstall 60 Sep 27 2018 examples

-rw-r–r–. 1 oracle oinstall 35K Apr 1 2019 index.html

-rw-r–r–. 1 oracle oinstall 58M Apr 2 2019 ords.war

drwxr-xr-x. 3 oracle oinstall 20 Apr 2 2019 docs

  1. Make a directory to hold the configuration and edit the database configuration template(params file) as below
[[email protected]]$ mkdir -p /home/oracle/devdoyensys/ords/conf[[email protected]]$ ls -lrth

total 58M

drwxr-xr-x. 2 oracle oinstall 35 May 31 2018 params

drwxr-xr-x. 6 oracle oinstall 60 Sep 27 2018 examples

-rw-r–r–. 1 oracle oinstall 35K Apr 1 2019 index.html

-rw-r–r–. 1 oracle oinstall 58M Apr 2 2019 ords.war

drwxr-xr-x. 3 oracle oinstall 20 Apr 2 2019 docs

drwxr-xr-x. 2 oracle oinstall 6 Oct 15 18:56 conf

vi /home/oracle/devdoyensys/ords/params/ords_params.properties

db.hostname=devdoyensys.com

db.port=1527

db.servicename=DEV

db.sid=DEV

db.username=APEX_PUBLIC_USER

migrate.apex.rest=false

rest.services.apex.add=true –set true

rest.services.ords.add=true

schema.tablespace.default=APEX

schema.tablespace.temp=TEMP

standalone.http.port=8080

#standalone.static.images=

user.tablespace.default=APEX

user.tablespace.temp=TEMP

  1. Set Oracle REST Database Service ORDS configuration directory
[[email protected]]$ cp ords.war ords.war_bkpoct15[[email protected]]$ mv ords.warapex.war[[email protected]]$ ls -lrth

total 115M

drwxr-xr-x. 6 oracle oinstall 60 Sep 27 2018 examples

-rw-r–r–. 1 oracle oinstall 35K Apr 1 2019 index.html

-rw-r–r–. 1 oracle oinstall 58M Apr 2 2019 apex.war

drwxr-xr-x. 3 oracle oinstall 20 Apr 2 2019 docs

drwxr-xr-x. 2 oracle oinstall 6 Oct 15 18:56 conf

drwxr-xr-x. 2 oracle oinstall 73 Oct 15 19:12 params

-rw-r–r–. 1 oracle oinstall 58M Oct 15 19:21 ords.war_bkpoct15

[[email protected]]$ /home/oracle/devdoyensys/jdk-13.0.1/bin/java -jar apex.warconfigdir /home/oracle/devdoyensys/ords/conf

Oct 15, 2020 7:26:04 PM

INFO: Set config.dir to /home/oracle/devdoyensys/ords/conf in: /home/oracle/devdoyensys/ords/apex.war

[[email protected]]$

Note:

If you need to restart the installation for any reason, remember to clear down the config directory

and check the contents of “/home/oracle/devdoyensys/params/ords_params.properties” file before you restart the installation.

Having password entries in this file from a failed installation can cause problems.

  1. Start the installation of ORDS
[[email protected]]$ /home/oracle/devdoyensys/jdk-13.0.1/bin/java -jar apex.war install advanced

Enter the name of the database server [testdoyensys.com]:

Enter the database listen port [1527]:

Enter 1 to specify the database service name, or 2 to specify the database SID [1]:

Enter the database service name [DEV]:

Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:

Enter the database password for ORDS_PUBLIC_USER:

Confirm password:

Requires to login with administrator privileges to verify Oracle REST Data Services schema.

Enter the administrator username:sys

Enter the database password for SYS AS SYSDBA:

Confirm password:

ORA-01017: invalid username/password; logon denied

Try again. Enter the administrator username:sys

Enter the database password for SYS AS SYSDBA:

Oracle Toma

Confirm password:

Retrieving information.

Enter the default tablespace for ORDS_METADATA [APEX]:

Enter the temporary tablespace for ORDS_METADATA [TEMP]:

Enter the default tablespace for ORDS_PUBLIC_USER [APEX]:

Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:

Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.

If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:

Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]:

Enter the database password for APEX_PUBLIC_USER:

Confirm password:

Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]:

Enter the database password for APEX_LISTENER:

Confirm password:

Enter the database password for APEX_REST_PUBLIC_USER:

Confirm password:

Oct 15, 2020 7:38:47 PM

INFO: reloaded pools: []

Installing Oracle REST Data Services version 19.1.0.r0921545

… Log file written to /home/oracle/ords_install_core_2020-10-15_193847_00441.log

… Verified database prerequisites

… Created Oracle REST Data Services proxy user

… Created Oracle REST Data Services schema

… Granted privileges to Oracle REST Data Services

… Created Oracle REST Data Services database objects

… Log file written to /home/oracle/ords_install_datamodel_2020-10-15_193908_00250.log

… Log file written to /home/oracle/ords_install_apex_2020-10-15_193910_00295.log

Completed installation for Oracle REST Data Services version 19.1.0.r0921545. Elapsed time: 00:00:25.294

Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2

  1. Optimize the database connection settings – add these lines to the apex.xml configuration file

cd /home/oracle/devdoyensys/ords/conf/apex/conf

vi apex.xml

add below lines,

<entry key=”jdbc.InitialLimit”>15</entry>

<entry key=”jdbc.MinLimit”>15</entry>

<entry key=”jdbc.MaxLimit”>50</entry> <———————–You can specify here the No of application users as per requirement.

  1. Prepare the application server directory for the Oracle Application Express images
[[email protected]]$ mkdir -p $CATALINA_HOME/webapps/i/[[email protected]]$ cd apex/[[email protected] apex]$ cp -R /home/oracle/devdoyensys/apex/images/* $CATALINA_HOME/webapps/i/
  1. Copy the ORDS application apex.warfile to the Apache Tomcat
Oracle Tomcat[[email protected]]$ cdords/[[email protected]]$ cpapex.war $CATALINA_HOME/webapps
  1. Startup the Apache tomcat application server
[[email protected] ~]$ . tomcat.env[[email protected] ~]$ cd $CATALINA_HOME/bin[[email protected] bin]$ sh startup.sh

Using CATALINA_BASE: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_HOME: /home/oracle/devdoyensys/apache-tomcat-9.0.27

Using CATALINA_TMPDIR: /home/oracle/devdoyensys/apache-tomcat-9.0.27/temp

Using JRE_HOME: /home/oracle/devdoyensys/jdk-13.0.1

Using CLASSPATH: /home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/bootstrap.jar:/home/oracle/devdoyensys/apache-tomcat-9.0.27/bin/tomcat-juli.jar

Tomcat started.

  1. Now navigate to apex login page http://devdoyensys.com:8080/apex

Reference: APEX Performance is Very Slow Using XDB HTTP Server / EPG (Doc ID 1409784.1)

This chapter contains information about configuring Tomcat to support your WebCenter Sites web application.

This chapter contains the following sections:

4.1 Quick Reference for Setting Up Tomcat Application Server

This section contains the following topics:

4.1.1 Summary of Steps

You will complete the steps below as necessary for your requirements for each environment: development, content management, and delivery.

Step 1: Configuring Tomcat Application Server

  1. Modify the default Tomcat ports as shown in Section 4.2.1, 'Modifying Tomcat Server Ports.'

  2. Create and configure a data source as shown in Section 4.2.2, 'Creating and Configuring a Data Source.'

  3. Set Java options as described in Section 4.2.3, 'Setting Java Options.'

  4. Set the classpath as described in Section 4.2.4, 'Setting the Classpath.'

  5. Set the URI encoding character set, as described in Section 4.2.5, 'Configuring URI Encoding.'

  6. If the server is a part of a multi-server environment, set the jvmRoute attribute as described in Section 4.2.7, 'Configuring a Tomcat Server for Load Balancing.'

  7. If the Tomcat server is part of a cluster environment, configure the server for clustering as described in Section 4.2.8, 'Configuring a Tomcat Server for Clustering.'

  8. If the server will be running over SSL, configure the Tomcat server for SSL as described in Section 4.2.9, 'Configuring a Tomcat Server for SSL.'

Step 2: Integrating Tomcat Application Server with a Supported Web Server

This step is required if:

  • You are creating a clustered environment that will be load balanced through Apache Web Server.

  • You wish to place an apache WebServer in front of Tomcat.

Steps for integrating Tomcat with Apache Web Server are given in Section 4.3, 'Step 2: Integrating Tomcat Application Server with a Supported Web Server.'

4.1.2 Paths and Directories Used in This Chapter

Table 4-1 lists the paths and directories used in this chapter.

Table 4-1 Paths and Directories Used in Configuring Tomcat Application Server

NameDescription

<sites_install_dir>

Path to the WebCenter Sites installation directory.

<tomcat_home>

Path to the Tomcat installation directory.

<shared_dir>

Path to the shared folder on the given system. The path includes the name of the shared folder.


4.1.3 Start/Stop Commands for Tomcat

This section lists commands for starting and stopping Tomcat instances.

Note:

All commands require that CATALINA_HOME and JAVA_HOME are set to the proper directories.

To start the Tomcat instance

Run the following command:

  • In UNIX:

  • In Windows:

To stop the Tomcat instance

Run the following command:

  • In UNIX:

  • In Windows:

4.2 Step 1: Configuring Tomcat Application Server

In this section, you will complete the following steps:

Note:

Procedures in this section use UNIX commands.

4.2.1 Modifying Tomcat Server Ports

This section explains how to modify the default ports used by Tomcat. In order to run more than one Tomcat server on the same physical server, these ports must be changed to avoid port conflicts.

Oracle Tomcat
  1. Shutdown the Tomcat server.

  2. Open the <tomcat_home>/conf/server.xml file in a text editor and modify the following ports:

    • Shutdown port (default 8005)

      This port is used when shutting down the Tomcat server.

    • HTTP port (default 8080)

      This is the main port from which web applications will be accessible.

    • Redirect port (default 8443)

      This port needs to be modified in both the HTTP and AJP connectors.

    • AJP port (default 8009)

      This port can be used for communicating with an Apache web server.

    • (SSL only) SSL HTTP port (default 8443)

      If you will be using SSL, change this port to the same value used in step 2.

  3. Save the changes.

4.2.2 Creating and Configuring a Data Source

  1. Choose the data source information that corresponds to the database you will be using and place the required JAR files in the <tomcat_home>/lib directory. Data source information in Table 4-2 will be used to create the data source in the next step.

    Table 4-2 Data Source Information

    Database DriverParametersValues

    JTDS (third-party driver)

    • DriverClass

    • Required .jar files

    • URL

    • net.sourceforge.jtds.jdbcx.JtdsDataSource

    • jtds-1.2.5 jar

    • jdbc:jtds:sqlserver://<server>:<dbport>/<dbname>

      Example: jdbc:jtds:sqlserver://127.0.0.1:1433/contentDB

    DB2

    • DriverClass

    • Required .jar files

    • URL

    • com.ibm.db2.jcc.DB2Driver

    • db2jcc.jar, db2cc_license_cu.jar

      Note: The db2jcc4.jar file is not supported. Installation will fail if the db2jcc4.jar file is used.

    • jdbc:db2://<hostname>:<dbport>/<dbname>

      Example: jdbc:db2://127.0.0.1:50001/contentDB

    Oracle Thin driver

    • DriverClass

    • Required .jar files

    • URL

    • oracle.jdbc.driver.OracleDriver

    • ojdbc6.jar

    • jdbc:oracle:thin:@//<hostname>:1521/<dbname>

      Example: jdbc:oracle:thin:@//127.0.0.1:1521/contentDB


  2. Open the <tomcat_home>/conf/server.xml file in a text editor and add the following XML code inside the Host tag, replacing any parameterized values:

    Sample data source for an Oracle Database:

    Note:

    In the example above the maximum allowed database connections is set to 100. While this is the recommended value, it may be changed depending on environment requirements.
  3. Save the changes.

4.2.3 Setting Java Options

This section explains how to set memory arguments as well as add Java options required by WebCenter Sites.

  1. Open <tomcat_home>/bin/setenv.sh in a text editor and add the line CATALINA_OPTS='<java_opts>' where <java_opts> is a space-separated list of the following options:

    • -Xms2048m -Xmx16834m

      These options set the minimum and maximum memory heap sizes. These are recommended sizes, but may be changed depending on environment requirements.

    • -XX:MaxPermSize=192m

      This option sets the maximum size of the permanent generation space. This is the recommended size, but may be changed depending on environment requirements.

    • -Dfile.encoding=UTF-8

      This option specifies UTF-8 file encoding.

    • -Dnet.sf.ehcache.enableShutdownHook=true

      This option enables the Ehcache shutdown hook.

    • -Djava.net.preferIPv4Stack=true

      This option specifies the use of IPv4 addresses.

    • -Duser.timezone=UTC

      This option is used to set the time zone for the JVM. It is recommended to set the value to UTC across all WebCenter Sites installations. However, you can set any preferable time zone as long as this value is the same for all WebCenter Sites installations. So, the complete CATALINA_OPTS should look like:

      Note:

      If Shift-JIS characters will be used, add the following option: -Dcs.useJavaURLDecoder=false
  2. Save the changes.

Oracle Tomcat Ords

4.2.4 Setting the Classpath

This section explains how to add paths required by WebCenter Sites to the application server classpath.

  1. Open <tomcat_home>/bin/setenv.sh in a text editor and add the following line: CLASSPATH='<paths>' where <paths> is a colon (:) separated list of the following paths:

    1. <sites_install_dir>/bin

      This path contains the required WebCenter Sites and CAS configuration files. Without this file, the CAS web application will not start and the System Tools node in the Admin tab of the WebCenter Sites Admin interface will have reduced functionality.

    2. $JAVA_HOME/lib/tools.jar

      This JAR file is located in the JDK.

  2. Save the changes.

4.2.5 Configuring URI Encoding

This section explains how to set the character set for URI encoding to UTF-8.

  1. Open <tomcat_home>/conf/server.xml in a text editor and add the URIEncoding attribute to the HTTP Connector tag as follows:

  2. Save the changes.

4.2.6 Configuring AJP Connectors

This section explains how to set encoding configuration for one or both HTTP and AJP connectors on the application server.

  1. Ensure all the language and file encoding configuration parameters are set to be UTF-8 throughout the entire infrastructure for multilingual and special character recognition.

  2. This includes the db, system variables, futuretense.ini file and the connectors as defined in the application server -including the AJP connector as needed, described in the Oracle Fusion Middleware Online Documentation Library 11g Release 1 (11.1.1.8) for WebCenter Sites installation and administration guides.

  3. The above circumstance (Tomcat also using Apache webserver) was resolved by the following:

    Add URIEncoding='UTF-8' in the HTTP and AJP Connectors in $CATALINA_BASE/conf/server.xml.

4.2.7 Configuring a Tomcat Server for Load Balancing

This section explains how to configure a Tomcat server so that it may be a part of a load balancing environment.

  1. Open <tomcat_home>/conf/server.xml in a text editor and add the jvmRoute attribute to the Engine tag as follows:

  2. Modify the value of jvmRoute so that it is unique from all other Tomcat servers that will be load balanced.

  3. Save the changes.

Tomcat Remove Abandoned

4.2.8 Configuring a Tomcat Server for Clustering

This section explains how to configure a Tomcat server to be part of a cluster.

Oracle Tomcat Tutorial

  1. Open <tomcat_home>/conf/server.xml in a text editor and add the following XML code as the first thing inside the Engine tag:

  2. Modify the Membership address or port as necessary:

    • Each cluster must have a unique Membership address/port combination to avoid message conflicts.

    • All members of a cluster must have the same values for Membership address and port.

  3. Modify the Receiver port or autoBind as necessary.

    The receiver will automatically avoid port conflicts between port and port plus autoBind by binding to a free port. Modify either of these values as necessary to restrict the range of ports the receiver will use.

  4. Save the changes.

4.2.9 Configuring a Tomcat Server for SSL

  1. Generate a certificate:

    1. Set the -keystore parameter to the location where you want the generated keys to be stored.

    2. When prompted for the keystore password, you may use your own password, or the default changeit. If a custom password is entered, a value in the server.xml file will need to be changed (as explained in step 2).

    3. Enter your first and last name, name of organization, city, state, and country code when prompted, then click Yes to confirm.

    4. At the next prompt, 'Enter key password for <tomcat> (RETURN if same as keystore password),' press Enter, as the key password must be the same as the keystore password.

  2. Edit <tomcat_home>/conf/server.xml, uncomment the SSL section, and add the following attributes to the SSL connector:

    • keystoreType='JKS'

      This attribute is set to JKS for Java Keystore (the format produced by Java's keytool).

    • keystoreFile='<tomcat_home>/keys/.keystore'

      This attribute is set to the path where the .keystore file was created and the same path used in step 1.

    • keystorePass='<new_password>'

      This attribute is needed only if the keystore password used in step 1 is not changeit, and should be set to the custom password used.

  3. Save the changes.

  4. After starting the server, point your browser to https://<tomcat_host>:<ssl_port>.

    If your system works correctly, you will be prompted to accept the certificate. When you accept the certificate, the Tomcat index page is displayed.

4.3 Step 2: Integrating Tomcat Application Server with a Supported Web Server

This section provides guidelines for integrating Tomcat Server with your choice of supported web servers.

Oracle Tomcat Free

4.3.1 Configuring Apache HTTP Server

Tomcat Oracle Wallet Configuration

This section explains how to configure Apache 2.2.x or Apache 2.4.x HTTP server with the mod_proxy_ajp plugin to use this plugin with Tomcat.

  1. Ensure that mod_so.c is enabled. Run <apache_home>/bin/apachectl -l. If mod_so.c is not in the list that is printed, you must rebuild your Apache with the -enable-module=so option.

  2. Open <apache_home>/config/httpd.conf in a text editor and add the following at the end of the file:

    Single Server Environment

    Multi Server Environment

    Note:

    In this example, the balancer-manager allows all access. For increased security you may want to modify the values of 'Deny from' and 'Allow from' using the Apache documentation as reference.

    If you will be installing the AVI Sports sample site, add timeout=180 at the end of each BalancerMember line.

  3. Save the changes.

  4. Verify the syntax of the httpd.conf file with the following command:

    <apache_home>/bin/apachectl -t

  5. Restart the web server.