<commit_before>Configure front-end web-application {#admin-configure-webapp}
==========================

[TOC]

Configuring Tomcat or Jetty as application container {#admin-configure-container}
====================================================

We are providing a WAR-file that is deployable by every common Java Servlet
Container like Tomcat or Jetty. Please use the documentation of the web
application container of your choice how to deploy these war-files.

## Tomcat: UTF8 encoding in server.xml ## {#admin-configure-tomcat-utf8}

If using Tomcat make sure the UTF-8 encoding is used for URLs. Some
installations of Tomcat don't use UTF-8 for the encoding of the URLs and that will
cause problems when searching for non-ASCII characters. In order to avoid this
the Connector-configuration needs the property "URIEncoding" set to "UTF-8"
like in this example (`$CATALINA_HOME/server.xml`):

\code{.xml}
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443"
executor="tomcatThreadPool" />
\endcode

General configuration advices {#admin-configure-general}
=============================

The ANNIS frontend will search in different folders for it's configuration.

Folder | Description
------ | -----------
`<Installation>/WEB-INF/conf/` | Default configuration inside the deployed web application folder. Should not be changed.
`$ANNIS_CFG` or `/etc/annis/` | The global configuration folder defined by the environment variable `ANNIS_CFG` or a default path if not set.
`~/.annis/` | User specific configuration inside the `.annis` sub-folder inside the user's home folder

Configuration files can be either in the [Java Properties](http://en.wikipedia.org/w/index.php?title=.properties&oldid=521500688)
or [JSON](http://www.json.org/) format. Configuration files from the user directory can
overwrite the global configuration and the global configuration overwrites the
default configuration.

Create and configure instances {#admin-configure-instance}
==============================

When multiple corpora from different sources are hosted on one server it is often
still desired to group the corpora by their origin and present them differently.
You should not be forced to have an ANNIS frontend and service installation for
each of this groups. Instead the administrator can define so called instances.

An instance is defined by a JSON file inside the instances sub-folder in one of
the configuration locations. The name of the file also defines the instance name.
Thus the file `instances/falko.json` defines the instance named "falko".

\code{.json}
{<commit_msg>make clear which users home directory is meant<commit_after>Configure front-end web-application {#admin-configure-webapp}
==========================

[TOC]

Configuring Tomcat or Jetty as application container {#admin-configure-container}
====================================================

We are providing a WAR-file that is deployable by every common Java Servlet
Container like Tomcat or Jetty. Please use the documentation of the web
application container of your choice how to deploy these war-files.

## Tomcat: UTF8 encoding in server.xml ## {#admin-configure-tomcat-utf8}

If using Tomcat make sure the UTF-8 encoding is used for URLs. Some
installations of Tomcat don't use UTF-8 for the encoding of the URLs and that will
cause problems when searching for non-ASCII characters. In order to avoid this
the Connector-configuration needs the property "URIEncoding" set to "UTF-8"
like in this example (`$CATALINA_HOME/server.xml`):

\code{.xml}
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443"
executor="tomcatThreadPool" />
\endcode

General configuration advices {#admin-configure-general}
=============================

The ANNIS frontend will search in different folders for it's configuration.

Folder | Description
------ | -----------
`<Installation>/WEB-INF/conf/` | Default configuration inside the deployed web application folder. Should not be changed.
`$ANNIS_CFG` or `/etc/annis/` | The global configuration folder defined by the environment variable `ANNIS_CFG` or a default path if not set.
`~/.annis/` | User specific configuration inside the `.annis` sub-folder inside the home folder of the user who is running the frontend.

Configuration files can be either in the [Java Properties](http://en.wikipedia.org/w/index.php?title=.properties&oldid=521500688)
or [JSON](http://www.json.org/) format. Configuration files from the user directory can
overwrite the global configuration and the global configuration overwrites the
default configuration.

Create and configure instances {#admin-configure-instance}
==============================

When multiple corpora from different sources are hosted on one server it is often
still desired to group the corpora by their origin and present them differently.
You should not be forced to have an ANNIS frontend and service installation for
each of this groups. Instead the administrator can define so called instances.

An instance is defined by a JSON file inside the instances sub-folder in one of
the configuration locations. The name of the file also defines the instance name.
Thus the file `instances/falko.json` defines the instance named "falko".

\code{.json}
{
{'fraction_non_alphanumeric': 0.12455449259050835, 'fraction_numerical': 0.011254924029262802, 'mean_word_length': 5.114678899082569, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1545499', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1313, 'n_words': 628}