Installation, build and deploy instructions for Ubuntu 18.04 LTS.
Log onto the development machine.
Install system-wide.
sudo apt-get install openjdk-8-jdk-headless
Install for current user.
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install grails 3.3.1
Navigate to a directory to perform the configuration and build.
cd ~/workspace/
If previously, a git clone
was done, do the following to update the repo.
cd openthesaurus/
git checkout .
git pull -r
Note that this will undo all custom configuration!
Otherwise, clone the repo.
git clone https://github.com/danielnaber/openthesaurus.git
cd openthesaurus/
Compare the shipped configuration files with the custom configuration files by running the following.
cd ../opentaal-openthesaurus/
./compare.sh
more customize.sh
Set the database and email user password in a file that is excluded by version control.
vi password
If no more changes need to be made, apply the custom configurtation.
./customize.sh
cd ../openthesaurus/
Do the actual build.
grails war
Copy the WAR file to the deployment machine.
scp `ls build/libs/openthesaurus-*.war|sort -n|tail -1` thehostname:/tmp
Log onto the deployment machine with SSH.
If needed, install MySQL.
sudo apt-get install mysql-server
Create databsae and user.
mysql -u root -p
******
create database openthesaurus;
create user 'openthesaurus'@'localhost' identified by '******';
grant all privileges on openthesaurus.* to 'openthesaurus'@'localhost';
exit
Test database and user. This should report an empty set of tables.
mysql -D openthesaurus -u openthesaurus -p
******
show tables;
exit
If needed, install an email service, snmp, such as postfix. Also install a way to easily test this, e.g. mailutils.
sudo apt-get install postfix mailutils
Create user for email account.
sudo adduser openthesaurus
Assuming, Tomcat is not yet installed.
sudo apt-get install tomcat8
Note that any dependencies such as openjdk-8-jre-headless will be installed automatically. Test page should appear on http://thehostname:8080/
Ony if realy needed, add an existing user to the Tomcat group
sudo vi /etc/group
and add the username after the line with tomcat8:x:
Remove the contents of Tomcat's ROOT
directory
sudo rm -rf /var/lib/tomcat8/webapps/ROOT/*
Extract the war file.
sudo unzip -d /var/lib/tomcat8/webapps/ROOT/ `ls /tmp/openthesaurus-*.war|sort -n|tail -1`
Note that no extra configuration is needed, even though some old documentation might suggest that.
In another terminal, monitor the log file.
sudo tail -f /var/log/tomcat8/catalina.out
Restart Tomcat.
sudo service tomcat8 restart
Create in-memory database, otherwise the website will result directly in errors.
curl -I http://localhost:8080/synset/createMemoryDatabase
Visit the instance of OpenThesaurus which is at http://thehostname:8080/
This repository contains the proper database connections. When a new version needs to be downloaded, go to https://dev.mysql.com/downloads/connector/j/ to get the latest download link to get the proper package. Then do the following.
cd /tmp
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.13-1ubuntu18.04_all.deb
dpkg -x mysql-connector-java_8.0.13-1ubuntu18.04_all.deb .
cp usr/share/java/mysql-connector-java-8.0.13.jar ~/workspace/opentaal-openthesaurus/1804/
For Ubuntu 18.10, download via https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.13-1ubuntu18.10_all.deb and copy the JAR file to ~/workspace/opentaal-openthesaurus/1804/
Note that installation of the database connection via a package from the operating system will not be available for Tomcat.