Support
-------
Please note:
We do not support external standalone installations. This instructions are only for validation purposes.

Operating system
----------------

It should work on most OSs, but we recommend to use Ubuntu LTS Linux.

Apache Tomcat Sevlet Container
------------------------------

Download Tomcat 8.5.x from https://tomcat.apache.org/download-80.cgi
(Tomcat 9 might work as well)

Extract Tomcat archive  to an arbitrary directory, which we will now call TOMCAT_HOME.

Tomcat should be configured with support for HTTPS.

Start Apache Tomcat server. ([TOMCAT_HOME]/bin/startup.sh)


PostgreSQL database
-------------------

WikiSpeech stores its data in a PostgreSQL database (and on the filesystem).
Download and install a PostgreSQL database server from https://www.postgresql.org
Create a PostgreSQL username, e.g. 'wikispeech' and a enter password (we will call it [pgsqlpw]):

createuser -U postgres -P wikispeech

Create the database 

createdb -U postgres -O wikispeech -E UTF-8 wikispeech

You might test the database connection with:

psql -U wikispeech wikispeech


Postgres JDBC driver
--------------------

The JDBC driver provides the connection between Java and PostgreSQL

Download the latest version from:
https://jdbc.postgresql.org/

and put the jar file to [TOMCAT_HOME]/lib/



WikiSpeech Build
----------------

Follow the instructions in the file Build.txt (in the same folder).


JAAS Authentication
-------------------

WikiSpeech uses JAAS authentication by the Tomcat Servlet Container.

Therefore two libraries are required in the Tomcat classpath:

cp target/wikispeech/WEB-INF/lib/jasypt-[jasypt_version].jar [TOMCAT_HOME]/lib/
cp target/wikispeech/WEB-INF/lib/ips.security-[ips_security_lib_version].jar [TOMCAT_HOME]/lib/

The JAAS Config file is generated and should be copied to the Tomcat configuration:

cp target/jaas.config [TOMCAT_HOME]/conf/

and activated. For example with the follwing commands:

echo 'JAVA_OPTS="$JAVA_OPTS -Djava.security.auth.login.config=${CATALINA_BASE}/conf/jaas.config"' >> [TOMCAT_HOME]/bin/setenv.sh

Note: The local development configuration uses a dynamic JAAS configuration file for JDBC access. Installation of the JAAS configuration file to the local Tomcat installation is therefore not necessary and will be ignored. 

Start/Stop Tomcat
-----------------

[TOMCAT_HOME]/bin/catalina.sh start

[TOMCAT_HOME]/bin/catalina.sh stop

Login
-----

Point your browser to the URL https://[yourtomacthostname]:[yourtlsport]/wikispeech

The WikiSpeech start page should appear.

Login: admin
Passwort: corpus

IMPORTANT: Immediately set a new password with the 'Profile' menu item in the right left corner and 'Set password'




Troubleshoot
------------

View Tomcat log files in [TOMCAT_HOME]/logs




