This section contains various articles on the installation, system requirements, and supported environments of App Studio. Appkit is most commonly run as a lightweight Java web application that can be deployed in any Java Servlet Container (application server) such as Tomcat, GlassFish, Jetty depending on your preferences or IT standards. The Appkit application is designed to be stateless, making deployment and scaling (for example, with load balancers a straightforward exercise.

Requirements

App Studio is a standalone application with the following requirements: We support the following JDKs:
ImportantFor Windows users, the Fusion start and stop logging output found in $Fusion\var\logs\metrics\metric.log tends to be more reliable when using AdoptOpenJDK.

Installation

  1. Download App Studio Enterprise.
  2. Copy the App Studio Enterprise zip file to any convenient path.
  3. Unzip the file, and follow the instructions provided in the README.md file.
App Studio Wizard is included when deploying Fusion Server. App Studio Enterprise is a template for building a standalone Appkit application for Fusion. All of the instructions are self contained in the README and relevant configuration files and will lead you through the simple and easy process of configuring an App Studio application. To get started, download the latest copy, and check out the instructions here.
Starting in Fusion 5.0, App Studio is no longer included in the Fusion UI. However, you can use App Studio Enterprise (ASE) to create apps in Fusion 5 and Fusion 4. See Deploy App Studio for instructions.
This article describes how to deploy App Studio in Fusion 5 or App Studio in Fusion 4.
Starting in Fusion 5.11.0, Fusion has deprecated the Webapps service. As of Fusion 5.11.0, you should instead deploy App Studio manually.
In Fusion 4.x, the default FUSION_PORT value is 8764. In Fusion 5.x, the default value is 6764.
  1. Create UI (create a new App Studio project)
    curl -v -u USERNAME:PASSWORD -H 'Content-type: application/json' -X POST 'https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/webapps' -d '{"id": "UI_ID","name": "UI_NAME","contextPath": "/UI_CONTEXT"}'
    
    
  2. Execute the command ./app-studio package to generate the app-studio-enterprise.war file. The file is created in the following location: /<$Application>/dist/app-studio-enterprise.war
  3. Deploy WAR (upload to webapps service)
    curl -v -u USERNAME:PASSWORD -X PUT -H 'Content-type: application/zip' 'https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/webapps/UI_ID/war' --data-binary @app-studio-enterprise.war
    
  4. Go to https://FUSION_HOST:FUSION_PORT/webapps/UI_CONTEXT/.

Configuring the application server

For development and testing purposes you can deploy the Appkit web application in any modern servlet container and it will run and serve queries as long as the computer has network access to the underlying search engine. This is a non-exhaustive list of servers that have been used to run Appkit applications:
  • Tomcat 6+
  • JBoss 8+
  • Jetty 6+
  • GlassFish 4+

Java runtime environment

Appkit requires Java JDK 1.8 to be installed on the application server. Java EE is not needed.

Memory allocation

You must make sure that the servlet container is configured with access to an adequate amount of memory and heap space. The standard Appkit application does not have specific requirements but specific modules (for example, the Social Module have a larger footprint.
Troubleshoot building and deploying Appkit apps.

Increasing memory allocation to Jetty when running with Maven

If you are using the Social Module with Appkit, you might have to increase the amount of memory available to the application server. When starting Appkit up with Maven set this environment variable:
export MAVEN_OPTS='-Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M'

Paths with encoded forward slashes not working in Tomcat

By default, specific versions of Tomcat do not allow encoded forward slashes (%2F) in a URL. To work around this problem set this System property:
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
This can be done either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running $CATALINA_HOME/bin/tomcat7w.exe (if using Tomcat 7, change as appropriate for your exact version).

Problem with accented and other UTF-8 characters

Appkit is completely stateless so all information for a Query is contained in the HTTP request. Because Tomcat by default is not configured to handle special characters (such as UTF-8) in URLs, Tomcat might be incorrectly interpreting the HTTP GET request. To correctly handle URLs, open the Tomcat server.xml file [tomcat installation folder]/conf/server.xml, find the <Connector> element, and add the URIEncoding attribute to it:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
For more information, see the Character Encoding FAQ on the Tomcat Wiki.If you are running Tomcat behind an HTTP server via AJP (Apache or IIS, for example), then you also must add the URIEncoding attribute to the AJP connector found in the Tomcat server.xml file:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

Error writing to Java Preference Store

In specific cases on Linux, there is an issue with the application server being able to write temporary and other system files. In that case, start up the container with this flag:
-Djava.util.prefs.userRoot=/some/writable/directory

IIS authentication with Tomcat

When using IIS as an authentication layer in front of Tomcat, the AJP connector must be told not to perform authentication in Tomcat:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" tomcatAuthentication="false" />

Long Tomcat startup times

There is a known issue with long Tomcat startup times. To avoid this, add this entry to the JVM params, applied in /usr/share/tomcat7/bin/catalina.sh:
JAVA_OPTS=(all your usual stuff plus:)-Djava.security.egd=file:/dev/./urandom

JVM proxy settings

You can configure your JVM to use an HTTP proxy for all outgoing network traffic by setting these system properties:
-Dhttp.proxyHost=${server}
-Dhttp.proxyPort=${port}
-Dhttp.proxyUser=${username}
-Dhttp.proxyPassword=${password}
When using Tomcat, you can configure proxy settings either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running $CATALINA_HOME/bin/tomcat7w.exe (if using Tomcat 7, change as appropriate for your exact version).

Installing Missing Image Codecs on a Windows server

The standard SUN JDK only ships with a limited number of image codecs, which are needed for manipulating images in Appkit (for example, when resizing to generate a preview). In particular, the standard JDK lacks support for TIFF images.To obtain the missing codecs, we recommend installing the Java Advanced Imaging Image I/O Tools, which are available free of charge from:http://download.java.net/media/jai-imageio/builds/release/1.1/INSTALL-jai_imageio.html#WindowsDown the page, you should download the JDK version of the toolkit and copy it to each delivery server that will be running Appkit:http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-1_1-lib-windows-i586-jdk.exeFollow the installation instructions for the toolkit.
For Windows users, the installation must be performed with a 32-bit JDK.*
After it has been installed, you must restart Tomcat to get the new codecs into the Java runtime. To verify which codecs are installed on the server, look for this output in Appkit.log when Tomcat starts again:
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule - Supported image formats:
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - BMP
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - bmp
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpg
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpeg
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - wbmp
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - png
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - PNG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPEG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - WBMP
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - TIFF
...

Missing web resources

Under some circumstances web resources such as fonts (.ttf/.woff etc.) cannot be retrieved resulting in missing icons in the UI. In many cases this is caused by a bug in the webJAR locator library affecting some Operating Systems. Installing Tomcat on a path containing blanks causes this bug to manifest itself. The fix is simply to move Tomcat to a blank-free location (for example, on Windows in C:\Tomcat\).

Typical production setup

Your production setup will be a matter of preference because Appkit imposes no specific requirements in terms of topology or infrastructure. Some organizations choose to front the application server (servlet container) with either Apache or another webserver. In a public-facing scenario, this can yield some gains when serving static content and creates a buffer between the outside world and the execution environment.

Using Windows Integrated Authentication for internal applications

If you would like to take advantage of Integrated Windows Authentication for single sign on in your search application, the typical pattern is to front the servlet container (for example, Tomcat) with Microsoft Internet Information Services. In this pattern IIS handles the authentication with Active Directory and then forwards the request to Tomcat where it is picked up by Appkit and used by our Security Module for user information, authorization or personalization.

Additional Information

Appkit runs in most Java servlet containers including Apache Tomcat, Jetty and GlassFish. The majority of our customers use Tomcat 8 for production systems.If using Tomcat, see the troubleshooting page for information on configuring the use of UTF-8 character encoding. (This resolves the most common issues with special characters.)Follow these steps to deploy an Appkit .war file:
  1. Ensure that Java 8 JDK Java 1.8 is installed.
    We do not recommend OpenJDK, which is installed by default in various Linux distributions. We recommend using the Oracle JDK only.
  2. Install your servlet container of choice, such as Tomcat 8.
  3. You will have been provided a web application archive (.war file) that contains an Appkit web application (such as twigkit-search.war). If using Tomcat, copy the provided .war file into Tomcat’s webapps folder.
  4. Start the servlet container.
  5. Several seconds later, a folder with the same name as the .war file will appear in the file system (for example, twigkit-search). You can then access the application in your browser at http://localhost:8080/{contextPath}, where {contextPath} is the name of the .war file (for example, http://localhost:8080/twigkit-search/). You can also access the Appkit logs in the file system at {tomcat}/logs/catalina.out.
Congratulations, your Appkit application has been successfully installed.