Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Before beginning installation get ready next things and settings:
MySQL 8.4 with created scheme and user with access to it (MySQL security group should allow inbound rules from new EC2 instance, default port 3306)
SMTP connection settings for sending emails
ElasticSearch connection settings (We’re not storing any critical data in ES, so it can be configured as single node cluster without failover configuration).
Usually you need Elasticsearch: address url, login, password, certificate fingerprint or crt file for https connections and apiKey if you’re using Elasticsearch cloud installation.
2
Launch new Linux server
TermWeb is Java web application and can work in the same environment as JDK (Windows x64, Linux x64 or Linux aarch64)
For data storage will be enough from 2 to 45GB depending on usage, verbosity of logs and your term base size.
Most term bases containing 100K-200K terms will work normally with 4GB-8GB of RAM
The more powerful CPU is better for huge imports/exports or constant small imports. But for daily usage will be enough about 2 vCores with at least 2.5GHz
Further instructions provided for linux distributions using yum package manager, for different package manager check documentation of your package manager.
Update everything after successful login sudo yum update and after most cases sudo reboot.
3
Configure Linux instance
In most cases we don’t need swap file because application is almost dead when it’s reading data from it. Instead we suggest to increase memory of your instance. But if your company policy requires it you may use next steps:
1. Calculate the swap space size (see):
a) 2 GB of RAM or less = swap size 2x the amount of RAM but never less than 32 MB
b) More than 2 GB of RAM but less than 32 GB = swap size 4 GB + (RAM – 2 GB)
c) 32 GB of RAM or more = swap size 1x the amount of RAM 2. For most use cases of TermWeb having more than 1GB of swap file is not necessary
Use the dd command to create a swap file on the root file system. In the command, bs is the block size and count is the number of blocks. The size of the swap file is the block size option multiplied by the count option in the dd command. Adjust these values to determine the desired swap file size. The block size you specify should be less than the available memory on the instance or you receive a "memory exhausted" error.
In this example dd command, the swap file is 2 GB (128 MB x 8):
sudo dd if=/dev/zero of=/swapfile bs=128M count=8 oflag=append conv=notrunc 3. Update the read and write permissions for the swap file:
sudo chmod 600 /swapfile 4. Set up a Linux swap area:
sudo mkswap /swapfile 5. Make the swap file available for immediate use by adding the swap file to swap space:
sudo swapon /swapfile 6. Verify that the procedure was successful:
sudo swapon -s 7. Enable the swap file at boot time by editing the /etc/fstab file.
sudo nano /etc/fstab
Add the following new line at the end of the file, save the file and exit:
/swapfile swap swap defaults 0 0 To disable swap file use next command: sudo swapoff /swapfile
Delete swap file if you want to decrease file system usage.
Some of the linux distributions comes with MariaDB files, which have same executables as MySQL. If you have plans to create DB backups on this linux server, then you need to remove MariaDB binaries and install MySQL client.
Remove MariaDB as replacement of MySQL. Yum example: * Remove mariadb files:
sudo yum remove mariadb mariadb-libs
sudo yum-config-manager --disable mariadb * Install mysql client:
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm See full list of available repos:
sudo yum install mysql80-community-release-el7-3.noarch.rpm
rm mysql80*.rpm
sudo yum install mysql-community-client For fresh instructions refere to official documentation:
4
Install JDK
Download and install latest build of Open JDK 8 or Oracle JDK 8. Higher versions of Java not supported right now. You may choose any vendor for JDK: Adopt JDK, Amazon Corretto JDK, Oracle, etc. As we know Oracle JDK 8 requires paid subscription per server installation.
sudo yum install java-1.8.0-amazon-corretto-devel
5
Install Tomcat 9.0
Download and install latest build of Tomcat 9.0. Higher versions not supported (v9 still receiving security updates)
We don’t know any good and trusted repository containing fresh versions of Tomcat so we can’t give to you any short command.
-Xms1g -Xmx1g stands for 1GB of java heap of Tomcat process. For server with RAM less than 4GB assign 50% to java heap. If bigger than 4GB then you can set about 75% of RAM to java heap.
Edit /opt/tomcat/conf/server.xml by adding next line to <Host> element, this will disable output of Tomcat version and stacktraces output:
If you have plans to use many languages per dictionary and user groups, like 30 languages and 50 user groups (multiplication result greater than 1000), you need to change default tomcat’s maximum accepted parameter count: in a file /opt/tomcat/conf/server.xml change: <Connector port="8080" protocol="HTTP/1.1" ... maxParameterCount="1000" /> to: <Connector port="8080" protocol="HTTP/1.1" ... maxParameterCount="3000" />
6
Install or configure Apache httpd server
Simply install latest version by running: sudo yum install httpd
Add next lines to /etc/httpd/conf/httpd.conf to disable printing server version in http headers for security reasons:
ServerTokens Prod
ServerSignature Off
Put next config to /etc/httpd/conf.d/hosts.conf or to any other virtual host file:
localhost:8080 stands for Tomcat default port.
Enabling HTTP/2 for Apache httpd
Enabling HTTP/2 for TermWeb speeds up initial page render about 3x times especially for anonymous users.
Prior to enable HTTP/2 you must have at least Apache httpd 2.4.17
To enable HTTP/2 protocol for host use next config: Protocols h2 h2c http/1.1 for your virtual host config, like this:
If after restarting httpd (apachectl restart) HTTP/2 is not available then check next things:
That you applied to both http and https connections new protocol
That your httpd config has enabled MPM event in /etc/httpd/conf.modules.d/00-mpm.conf you need to uncomment there next line:
# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
LoadModule mpm_event_module modules/mod_mpm_event.so
Unpack and move contents of termweb-4.0.9-13.war (it’s regular zip archive) into <tomcat_folder>/webapps/ROOT folder (don't forget to cleanup it first by removing all preinstalled files, if you’re not using Tomcat manager): sudo unzip termweb-4.0.9-13.war -d /opt/tomcat/webapps/ROOT
Download and install mysql-connector-j into /opt/tomcat/webapps/ROOT/WEB-INF/lib Go to https://dev.mysql.com/downloads/connector/j/ and select platform independent version of connector compatible with MySQL version 8.4 (before TermWeb version 4.0.9-12 use MySQL 8.0) Since version 4.0.9-12 please use connector version 9.2.0 For versions prior 4.0.9-12 use connector version 8.0.33
Unpack and move it to lib folder mentioned before: tar xf mysql-connector-j-9.2.0.tar.gz && cp mysql-connector-j-9.2.0/mysql-connector-j-9.2.0.jar /opt/tomcat/webapps/ROOT/WEB-INF/lib
Make all files accessible by tomcat sudo chown -R tomcat:tomcat /opt/tomcat/webapps/ROOT
Unpack termweb-ui.zip archive and copy contents of dist folder into /var/www: unzip termweb-ui-4.0.9-13.zip -d termweb-ui/ sudo mkdir /var/www/termweb4 sudo cp -a /home/ec2-user/termweb-ui/dist/. /var/www/termweb4/ sudo chown -R apache: /var/www/termweb4/ sudo chmod -R 400 /var/www/termweb4 sudo find /var/www/termweb4 -type d -exec chmod u+x {} \; sudo restorecon -R -v /var/www/termweb4
Create and configure termweb.properties
Create and open for editing the unit file by running this command: /opt/termweb/home/termweb.properties
To be able to start successfully TermWeb you need to configure at least this properties: