Direkt zum Hauptinhalt

Basic installation with Jetty and H2 Database

Install Required Software

#install a lot of stuff
sudo apt update
sudo apt install tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng libtesseract-dev ffmpeg mediainfo mediainfo-gui openjdk-11-jdk
 
#install Jetty Web Server
sudo apt install jetty11
 
#check versions
ffmpeg -version
tesseract -v
mediainfo --version
dpkg -l | grep jetty11
dpkg -l | grep jdk

You can also install jetty manually (not by apt) with ease and full control:

cd /opt
wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/11.0.15/jetty-home-11.0.15.tar.gz
tar -xvzf jetty-home-11.0.15.tar.gz
mkdir -p /opt/jetty-home-11.0.15/jetty-base/
cd /opt/jetty-home-11.0.15/jetty-base/
java -jar ../start.jar --add-modules=deploy,http
cp /opt/teedy/docs-web/target/docs-web-1.*.war /opt/jetty-home-11.0.15/jetty-base/webapps/dms.war #copy the compiled deployment war to target dir
chown jetty:adm /opt/jetty-home-11.0.15/jetty-base/webapps/dms.war
chown jetty:adm /opt/jetty-home-11.0.15/jetty-base/webapps/dms.xml

Create dms.xml configuration files

This allows to change the default docs home dir and other things. Have a look at https://github.com/sismics/docs/blob/master/docs.xml

vim /opt/jetty-home-11.0.15/jetty-base/webapps/dms.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/dms</Set>
  <Set name="war"><SystemProperty name="jetty.data" default="."/>/webapps/dms.war</Set>
  <Call class="java.lang.System" name="setProperty">
    <Arg>docs.home</Arg>
    <Arg>/var/docs</Arg>
  </Call>
</Configure>

Adjust the following lines according to your configured XML argument docs.home (if changed)

mkdir -p /var/docs/
chmod -T 770 /var/docs/
chown -R jetty:jetty /var/docs/

Take the pre-built dms.war file or compile on your own and put it to /opt/jetty-home-11.0.15/jetty-base/webapps/dms.war

Tuning

Raise the heap space Xmx to prevent "java heap space error" - this often occures when OCR'ing a lot of files or uploading multiple files at once. This causes to restart jetty9 completely

sudo vim /lib/systemd/system/jetty11.service
Environment="JAVA_OPTS=-Xms1024m -Xmx3584m -Djava.awt.headless=true"

See also Environment Configuration for reference

JDK/JRE - Permissions Policy Adjustments (optional)

that might be dangerous / unsecure

sudo vim /usr/lib/jvm/java-11-openjdk-amd64/lib/security/default.policy

Add to top of file:

grant {
    permission java.security.AllPermission "", "";
};

Fix jetty read-only filesystem (since Jetty 9.4.15)

Sympton → "Caused by: java.io.FileNotFoundException: /var/docs/db/docs.trace.db (file system is readonly - but it is not!)"

The newest jetty package was changed to contain restricted settings in /lib/systemd/system/jetty9.service. You need to add another ReadWritePath for the /var/docs directory

sudo vim /lib/systemd/system/jetty11.service
ProtectSystem=strict
ReadWritePaths=/var/lib/jetty11
ReadWritePaths=/var/docs/

Restart Jetty Service

sudo systemctl restart jetty11.service

Check the logs

sudo less /var/log/jetty11/
sudo journalctl -f -u jetty11

Access to Teedy Web Interface

https://YOURHOST:8080