Data privacy notice

 

When this content is loaded, usage information is transmitted to Vimeo and may be processed there.

 

             

Tomcat settings

Modified on Wed, 25 Sep at 4:59 PM

CONTENTS


The settings described on this page should be performed for every system. Additional optional settings include:

  • Access via HTTPS
    Configuration of the Tomcat to provide access via HTTPS
  • Using FORMCYCLE with the root domain
    Open FORMCYCLE from the from the root domain, eg. http://formcycle.eu/, instead of from a subdomain such as http://formcycle.eu/formcycle/
  • Changing the data directory
    Directory containing data and settings used internally by FORMCYCLE.

Memory

The following settings should be applied to increase the amount of available memory. The sum of the on-heap and off-heap size should not exceed the total amount of available RAM.

  • -Xms512m
    Initial size of the on-heap.
  • -Xmx4096m
    Maximum size of the on-heap.
  • --XX:MaxDirectMemorySize=3072m
    Maximum size of the off-heap. Unless configured otherwise, the off-heap is used for the form and file cache.

Example (Linux)

The path to the configuration file is TOMCAT_VERZEICHNIS/bin/setenv.sh

export JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx4096m"

Setting on the connector

The following settings should be made in the configuration file TOMCAT_VERZEICHNIS/conf/server.xml:

<Connector port="80" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
           URIEncoding="UTF-8"
           maxPostSize="10485760"
           maxHttpHeaderSize="65536"
           relaxedQueryChars="[ \ ] ^ ` { | }" ></Connector>

More information about the parameters you will find in the following sections.

Limiting the upload file size

You can change the maximum allowed file size for file uploads for the upload form element, as well as the maximum size for uploads in the inbox. An error will be displayed when files larger than this limited are uploaded.

You can find the configuration file here: TOMCAT_DIRECTORY/conf/server.xml

The following option must be set or change on the connector:

maxPostSize="maximum size in bytes"

Example for a maximum upload size of 10 MB, to be specified in bytes:

<Connector ...
            maxPostSize="2097152" 
           ... />

HTTP header size limit

When an incoming HTTP request is made, Tomcat will refuse to accept the request when the HTTP headers are too large and return a 400 error (invalid request). With this option, you can change that limit. This may be neccessary when using the Kerberos authentication protocol, which makes use of many HTTP headers.

TYou can find the configuration file here: TOMCAT_DIRECTORY/conf/server.xml.

The following option must be set or change on the connector:

maxHttpHeaderSize="Header size limit in bytes"

Example for a limit of 64KB, to be specified in bytes:

<Connector ...
            maxHttpHeaderSize="65536" 
           ... />

UTF-8

When you notice issues with the special characters of foreign letters, for example when translating a form to Arabic or Chinese, check whether the URIEncoding has been set on the connector. The path to the configuration file is TOMCAT_DIRECTORY/conf/server.xml. The parameter should be set as follows on the connector:

URIEncoding="UTF-8"


Example

<Connector ...
            URIEncoding="UTF-8" 
           ... />


If there are also display problems with filenames with special characters and/or umlauts, please add the following Java parameter:

-Dfile.encoding=UTF-8


Depending on the used operating system, this must either be specified in the configuration file or configuration view:

Adding the Java-parameter for encoding

Adding the Java-parameter for encoding (open in <Tomcat-directory>/bin/tomcat9w.exe)


Alternatively, the parameter can also be defined in a setenv.bat file.


Note: After adding the parameter, the Tomcat must be restarted. The Java options will then be initialised again.

Example (Linux)

The path to the configuration file is TOMCAT_DIRECTORY/bin/setenv.sh

export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"

Session timeout

Should the default setting of 30 minutes not be sufficient, the session timeout can be increased by modifying the file web.xml. Uses will be logged out when they are idle longer than this limit.

The path to the  configuration file is TOMCAT_DIRECTORY/webapps/formcycle/WEB-INF/web.xml

<!-- Sets the sesssion timeout to 30 minutes -->
<session-config>
    <session-timeout>30</session-timeout>
</session-config>

Context name

The context name is used, for example, by Monitoring Beans to monitor the server status.

The context name defaults to the name of the WAR file of FORMCYCLE, but it can be changed when necessary by modifying the context parameter XFC_CONTEXT_NAME in the configuration file web.xml.

<context-param>
  <param-name>XFC_CONTEXT_NAME</param-name>
  <param-value>formcycle</param-value>
</context-param>

User path for Tomcat

On some Linux-based systems, the Tomcat user does not have a user folder by default. However, one is needed so that FORMCYCLE can store basic settings. The path of the user folder is usually defined in the /etc/passwd file.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article