1.3.2.1 Deploying to Apache Tomcat

The example in this topic shows how to deploy the graph server as a web application with Apache Tomcat.

The graph server will work with Apache Tomcat 9.0.x.

  1. Download the Oracle Graph Webapps zip file from Oracle Software Delivery Cloud. This file contains ready-to-deploy Java web application archives (.war files). The file name will be similar to this: oracle-graph-webapps-<version>.zip.
  2. Unzip the file into a directory of your choice.
  3. Locate the .war file that follows the naming pattern: graph-server-<version>-pgx<version>.war.
  4. Configure the graph server.
    1. Modify authentication and other server settings by modifying the WEB-INF/classes/pgx.conf file inside the web application archive. See User Authentication and Authorization section for more information.
    2. Optionally, change logging settings by modifying the WEB-INF/classes/log4j2.xml file inside the web application archive.
    3. Optionally, change other servlet specific deployment descriptors by modifying the WEB-INF/web.xml file inside the web application archive.
  5. Copy the .war file into the Tomcat webapps directory. For example:
    cp graph-server-<version>-pgx<version>.war $CATALINA_HOME/webapps/pgx.war

    Note:

    The name you give the war file in the Tomcat webapps directory determines the context path of the graph server application. It is recommended naming the war file as pgx.war.
  6. Configure Tomcat specific settings, like the correct use of TLS/encryption.
  7. Ensure that port 8080 is not already in use.
  8. Start Tomcat:
    cd $CATALINA_HOME 
    ./bin/startup.sh 

    The graph server will now listen on localhost:8080/pgx.

    You can connect to the server from JShell by running the following command:

    
    $ <client_install_dir>/bin/opg4j --base_url https://localhost:8080/pgx -u <graphuser>