Install on JBoss

You can install  as an installable web application ARchive (WAR), on a local machine running JBoss/WildFly.
lac53
You can install 
Layer7 Live API Creator
 as an installable web application ARchive (WAR), on a local machine running JBoss/WildFly.
Use the following process to install on JBoss/WildFly:
3
Verify the Prerequisites
Before you install 
Layer7 Live API Creator
 on JBoss/WildFly Web server, ensure that you have completed the following prerequisites:
  • You are familiar with JBoss/WildFly.
  • You have installed JBoss/WildFly and it is running.
    You can install and configure JBoss/WildFly applications using one of the following methods:
    • Using the JBoss Server GUI
    • Using the command line
    • Editing XML files directly
    • Making API calls
  • You have installed the Java Development Kit (JDK) version that 
    Layer7 Live API Creator
     supports.
    For more information:
  • You have created a 
    JAVA_HOME
     environment variable and set the value to point to the JDK installation directory.
    If you have not already done this, complete the following based on your operating system:
    (Windows)
     Set the value for the 
    JAVA_HOME
     environment variable as the path to your JDK installation. If you did not change the path during installation, it is something like 
    C:\Program Files\Java\jdk1.8.0_92
    . If the path contains spaces, use the shortened path name, for example, 
    C:\PROGRA~2\Java\jdk1.8.0_92
    . Close and re-open any command line windows that you had open before you made these changes, since you cannot reload environment variables from an active command prompt. If the changes do not take effect after reopening the command window, restart Windows.
    (Mac)
     From terminal, set the 
    JAVA_HOME
     environment variable using the following command:
    export JAVA_HOME=/Library/Java/Home
  • You know the license type that you are using 
    Layer7 Live API Creator
     under, either a standard license that the CA Support site issues or an Enterprise Software Portfolio License Agreement (PLA).
    For more information about licensing, see Licensing.
  • You have reviewed the installation best practices.
    For more information about these best practices, see Installation Best Practices.
(Optional) Bundle the Admin Repository into the WAR File
You can bootstrap 
Layer7 Live API Creator
 with a specific configuration for your API metadata by bundling the admin repository into the 
CALiveAPICreator.war
 file. For example, you have configured 
Layer7 Live API Creator
 in your development environment, and you want to include this configuration in the 
CALiveAPICreator.war
 file and deploy it to a server.
If you are persisting the authentication tokens that 
Layer7 Live API Creator
 dynamically generates by way of an authentication database, you can also bundle the definition of the data source for the authentication token database (the 
ApiKey.json
 file) into the WAR file.
You can bundle the admin repository and the definition of the data source for the authentication token database into the WAR file using a script. For more information about this script, see Example: Deploy the Bundled WAR to a Cluster.
Prerequisite:
 If you are licensed to use 
Layer7 Live API Creator
 under a PLA, you have verified that the admin repository includes the 
system/telemetry.json
 file and that it is configured to collect and send 
Layer7 Live API Creator
-specific usage data.
You can also activate 
Layer7 Live API Creator
 and configure it to send usage data after you have started API Server. For more information, see Activate and Configure to Send Usage Data.
For more information:
Follow these steps:
  1. Create the 
    WEB-INF/classes
     directory.
  2. Create the 
    configuration.zip
     file from your admin repository (the 
    teamspaces
     and 
    system
     directories).
    For more information about these directories, see View your API Definition.
  3. Copy the following files to the 
    WEB-INF/classes
     directory:
    • The 
      configuration.zip
       file.
    • (Optional) The 
      ApiKey.json
       file for your environment.
  4. From the command line window, bundle the files that are in the 
    WEB-INF
     directory into the WAR file by issuing the following command:
    jar uvf <war file> WEB-INF
    Step 3 of the sample script bundles these files into the WAR file.
The admin repository (and optionally the definition of the data source for the authentication token database) is added to the 
CALiveAPICreator.war
 file.
Install on JBoss/WildFly
You can install the 
Layer7 Live API Creator
 components—API Creator, API Server, and Data Explorer—simultaneously or (if you are advanced user and you want greater flexibility) each of the components individually. Use the WAR files that are included in the 
Layer7 Live API Creator
 installation zip file.
For more information about how to install WAR files in your JBoss/WildFly Web server, see the WildFly documentation.
Layer7 Live API Creator
 points to the file names that are installed under the same level by default. Do not install the 
DataExplorer.war
 file in a different directory location. If you rename one of these files, you must change the URL you use to access that component.
Install all the components simultaneously using the 
development/CALiveAPICreator.war
 file.
Follow these steps:
  1. Retrieve the 
    development/CALiveAPICreator.war
     file from your 
    Layer7 Live API Creator
     installation bundle and copy it to the 
    ${JBOSS_HOME}/webapps
     directory.
  2. (If you want 
    Layer7 Live API Creator
     to be at the root URL) Rename the 
    CALiveAPICreator.war
     file to 
    ${JBOSS_HOME}/webapps/ROOT.war
    .
Install an individual 
Layer7 Live API Creator
 component using the WAR file pertaining to that component. These files are located in the 
production
 directory.
Follow these steps:
  1. Retrieve the WAR file for the component that you want to install from your 
    Layer7 Live API Creator
     bundle and copy it to the 
    ${JBOSS_HOME}/webapps
     directory:
    • APICreator.war
      , which installs API Creator.
    • APIServer.war
      , which installs API Server.
    • DataExplorer.war
      , which installs Data Explorer.
    You can copy one or more component WAR files into the 
    ${JBOSS_HOME}/webapps
     directory.
  2. (If you want API Server to be at the root URL) Rename the 
    APIServer.war
     file to 
    ROOT.war
    .
Verify your Installation
Verify that you have installed 
Layer7 Live API Creator
 correctly and that there are no exceptions by checking the logs. If the installation is successful, A logging message appears similar to the following:
14:46:35,205 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "CALiveAPICreator.war" (runtime-name: "CALiveAPICreator.war")
14:46:37,534 WARN [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0013: Deployment deployment "CALiveAPICreator.war" contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)
14:46:37,655 INFO [stdout] (ServerService Thread Pool -- 84) Layer7 Live API Creator is starting on platform: WildFly 2.2.0.Final - 1.4.0.Final
14:46:37,660 INFO [com.kahuna.server.servlet.KahunaServletContextListener] (ServerService Thread Pool -- 84) TimeZone is Pacific Standard Time and locale is English (United States) - Observes Daylight Saving: true
14:46:37,668 INFO [com.kahuna.server.util.JndiUtil] (ServerService Thread Pool -- 84) Using default integer value for caGatewayLACPort of -1
14:46:37,668 INFO [stdout] (ServerService Thread Pool -- 84) Standard DataSource Admin connection
14:46:37,668 INFO [com.kahuna.admin.entity.AdminManager] (ServerService Thread Pool -- 84) Standard DataSource Admin connection
14:46:37,928 INFO [stdout] (ServerService Thread Pool -- 84) Found com.mysql.jdbc.Driver to use for generic MySQL/MariaDB driver
14:46:38,162 INFO [com.kahuna.server.servlet.KahunaServletContextListener] (ServerService Thread Pool -- 84) Layer7 Live API Creator is starting up - version <version> - schema version is: 20161121
14:46:38,227 INFO [com.kahuna.server.servlet.KahunaServletContextListener] (ServerService Thread Pool -- 84) This instance of Layer7 Live API Creator is licensed for evaluation only.
14:46:38,844 INFO [stdout] (ServerService Thread Pool -- 84) Layer7 Live API Creator: REST service is starting
14:46:39,378 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 84) WFLYUT0021: Registered web context: /LAC
14:46:39,392 INFO [org.jboss.as.server] (External Management Request Threads -- 9) WFLYSRV0010: Deployed "CALiveAPICreator.war" (runtime-name : "CALiveAPICreator.war")
This logging message output indicates that the 
Layer7 Live API Creator
 REST service has started.
You can safely ignore the WARNING or ERROR messages that appear for database types where you did not install the JDBC driver, for example:
14:46:37,928 ERROR [stderr] (ServerService Thread Pool -- 84) Unable to load PostgreSQL driver
14:46:37,928 WARNING [abl.sysdbg] (ServerService Thread Pool -- 84) Unable to load PostgreSQL driver: java.lang.ClassNotFoundException: org.postgresql.Driver from [Module "deployment.CALiveAPICreator.war:main" from Service Module Loader]
Optional Configuration
The following topic provides optional configuration details.
The following optional configuration requires that you restart JBoss after you configure.
Configure External Logging
You can create a logger for externalizing your API logs.
For more information about how to configure external logging, see External Logging.
Next Steps
Complete the following procedures after you have installed 
Layer7 Live API Creator
 on JBoss/WildFly.
Enable Other Options at Startup
The following are options that you can enable at startup:
For more information about these options and other options that you can add when you start API Server, see API Server Startup Options.
Bypass the Extra Step at Login to Accept the EULA
If you are deploying into production using a cluster or if you are scripting deployment, you can bypass the API Creator screen that asks the initial TeamSpace user to log in to accept the user license, which pre-accepts the terms of the EULA. You can pre-accept the terms of the EULA by adding the following option when you start API Server:
CA_ACCEPT_LICENSE=ENU
Example:
-Dca_accept_license=ENU
Specify this option only once. Do not specify this option as part of normal operations.
Specify an Alternate License File
If you are licensed to use 
Layer7 Live API Creator
 under a standard license, the first time that you start JBoss/WildFly with 
Layer7 Live API Creator
, you must install the API Server license file. You can install this file when you start API Server by adding the following option when you start API Server:
LAC_DEFAULT_LICENSE_FILE
 
Example:
 
<...JBoss/WildFly startup...> -DLAC_DEFAULT_LICENSE_FILE=/Users/jdoe/License.txt
Specify this option only once. Do not specify this option as part of normal operations.
Change the Initial Password for the System Administrator User and for the Initial API Developer
If you did not change the initial passwords for the system administrator (
sa
) user and for the initial API developer (a TeamSpace user) for the default TeamSpace as options when you start API Server, change the passwords. Add the 
LAC_INITIAL_SA_PASSWORD
 and the 
LAC_INITIAL_ADMIN_PASSWORD
 options when you start API Server, for example:
<...JBoss/WildFly startup...> -DLAC_INITIAL_SA_PASSWORD=<MySAPassword>
For more information:
Specify the Location from Where you Want 
Layer7 Live API Creator
 to Pull your Admin Repository
By default, when you first start API Server, 
Layer7 Live API Creator
 pulls your admin repository from the location that you defined for the 
LAC_REPOSITORY_ROOT
 option. You can change this location by adding the following option when you start API Server:
LAC_REPOSITORY_CONFIGURATION_URL
Example:
<...JBoss/WildFly...> -DLAC_REPOSITORY_CONFIGURATION_URL=<Complete path to your admin repository, URL or Git>
Specify the Location to Where you Want 
Layer7 Live API Creator
 to Add your Admin Repository
The first time that you start JBoss/WildFly with 
Layer7 Live API Creator
, you can set the location for your admin repository by adding the following option when you start API Server:
LAC_REPOSITORY_ROOT
Example:
<...JBoss/WildFly...> -DLAC_REPOSITORY_ROOT=${HOME}/CALiveAPICreator.repository
You can change the location by adding this option when you start JBoss/WildFly.
Log in to API Creator
You can access the 
Layer7 Live API Creator
 component WAR files that you have copied to the 
${JBOSS_HOME}/webapps
 directory using a URL that includes the name of the WAR file. The following URL is an example on how you access API Creator if you installed it on your local host.
 
Follow these steps:
 
  1. Enter the following URL into a browser window:
    http://localhost:8080/APICreator
    The API Creator logon authentication dialog opens.
  2. Complete the following fields, and then click 
    Login
    :
    If the 
    default
     TeamSpace is the only TeamSpace that exists, you are the initial TeamSpace user, and you are just starting to use API Creator, the user name for this user is 
    admin
    .
    Server
    The URL and location of API Server, which can include the root web application archive (WAR) file's name.
    Example:
    /APIServer
    The server location and name depends on the type of installation and configuration of your API.
    Username
    The username for the initial API developer that 
    Layer7 Live API Creator
     creates when you install 
    Layer7 Live API Creator
    , which is 
    admin
    . Enter 
    admin
    .
    Password
    The TeamSpace user's password. Enter 
    Password1
    .
  3. If this is your first time logging in to API Creator, accept the terms of the EULA. You must accept these terms before you can use API Creator.
You are logged in to API Creator as the administrator user (admin).
Configure 
Layer7 Live API Creator
 to Collect and Send Usage Data
If you are licensed to use 
Layer7 Live API Creator
 under a PLA, you must activate 
Layer7 Live API Creator
 and configure it to collect and send usage data. If you are licensed to use 
Layer7 Live API Creator
 under a standard license, you can consent to 
Layer7 Live API Creator
 collecting and sending telemetry data, or system and usage data.
For more information about how to configure to collect and send usage data, see Activate and Configure to Send Usage Data.
Import the API Server License
The API Server license controls access to API Creator and services. If you are licensed to use 
Layer7 Live API Creator
 under a standard license and you did not specify a license file when starting JBoss/WildFly (by adding the 
LAC_DEFAULT_LICENSE_FILE
 option when you started JBoss/WildFly), you must now upload it.
For more information about licensing, see Licensing.
Install the Admin CLI
If you want to manage your 
Layer7 Live API Creator
 installation from the command line or using scripts, install the Admin command-line interface (CLI). With the Admin CLI installed, you can manage your admin services, such as migrating APIs–including your JavaScript user libraries, resources, authentication providers, and API Gateway definitions–to a newer version of 
Layer7 Live API Creator
.
 For more information:
Begin Exploration of the API Samples
For more information about these samples, see Tutorials and Samples.
Advanced Configuration
The following topics provide advanced configuration details.
Configure to Run as a Cluster
You can configure 
Layer7 Live API Creator
 for scalability and increased performance by configuring it to run as a cluster within multiple nodes.
For more information about how to configure 
Layer7 Live API Creator
 to run as a cluster, see Configure to Run as a Cluster.
Create a Database for your Authentication Tokens
By default, 
Layer7 Live API Creator
 generates authentication tokens, stores them in the in-memory Derby database, and synchronizes them to your admin repository in the following cases:
  • You have configured 
    Layer7 Live API Creator
     to run as a single node.
  • You are running in a local development environment.
  • You have specified an authentication provider that uses the 
    Default Auth Provider
     authentication method (for example, the 
    built-in authentication
     authentication provider) or a custom JavaScript authentication provider that uses the 
    JavaScript Auth Provider
     authentication method as the authentication provider for your API.
You can optionally have 
Layer7 Live API Creator
 store the authentication tokens that it generates for API users in a database instead by creating one.
For more information about how to create this database, see Create a Database for your Authentication Tokens.
Install JDBC Drivers
If you plan to create a database for 
Layer7 Live API Creator
 to store the authentication tokens that it generates for API users, then 
Layer7 Live API Creator
 requires the corresponding JDBC driver to the database management system (DBMS) that you use as this database. It also requires the JDBC drivers for any other databases that you plan to access.
You can install JDBC drivers using 
one
 of the following methods:
For more information:
Register the JDBC Driver Module as a Global Module
Create the JDBC driver module using one of the available methods and then make the JDBC driver accessible to other modules. You make the JDBC driver module accessible to other modules by registering the module as a global module.
Complete the following procedure in standalone mode.
Follow these steps:
  1. Open the configuration file (for example, 
    standalone.xml
    ).
  2. Register the JDBC driver module as a global module. Add the following XML elements and attributes to the 
    subsystem
     section of the configuration file:
    ...
    <subsystem xmlns="urn:jboss:domain:ee:5.1">
    <global-modules>
    <module name="com.mysql" slot="main"/>
    </global-modules>
    ...
    For more information about how to define the module as a global module, see the WildFly website.
  3. Configure the Java Enterprise Edition (Java EE) default bindings. Replace the default data source value (
    java:jboss/datasources/ExampleDS
    ) that is defined in the 
    default-bindings
     section the configuration file with the JNDI name for the authentication token database ():
    ...
    <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:/jdbc/MyDB" ... />
    ...
  4. Save your changes to the file.
You have registered the module as a global module and configured the Java EE default bindings