TermWeb 4 install on Windows

 

1

Prerequisites

Before beginning installation get ready next things and settings:

  • MySQL 8.0 with created scheme and user with access to it (MySQL security group should allow inbound rules from new EC2 instance, default port 3306)

    -- Create schema script, character set and collation must be unchanged CREATE DATABASE `termweb_prod` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER 'termwebuser'@'%' IDENTIFIED BY 'sEcr3t!'; GRANT ALL PRIVILEGES ON `termweb\_prod`.* TO 'termwebuser'@'%';
  • SMTP connection settings for sending emails

  • Elasticsearch connection settings (ES security group should allow inbound rules from new EC2 instance, default ports 9200 and 9300)

2

Launch new Windows Server 2019

  • For data storage will be enough 30-45GB depending on usage and log level

  • Update everything after successful login and reboot.

3

Configure Windows instance

Configure swap file

  • Calculate the swap space size (see):

    • 2 GB of RAM or less = swap size 2x the amount of RAM but never less than 32 MB

    • More than 2 GB of RAM but less than 32 GB = swap size 4 GB + (RAM – 2 GB)

    • 32 GB of RAM or more = swap size 1x the amount of RAM

  • For current example use 2GB swap size.

4

Install JDK

Download and install latest build of Open JDK Corretto 8 https://corretto.aws/downloads/latest/amazon-corretto-8-x64-windows-jdk.msi

5

Install Tomcat 9.0

Download and install Core version with Windows Service installer: https://downloads.apache.org/tomcat/tomcat-9/v9.0.41/bin/apache-tomcat-9.0.41.exe, don’t install manager, host manger, examples or documentation. Choose for example C:\tomcat folder for installation, or proceed with default.

Specify JDK instead of JRE as Java VM:

Leave other options with default values.

 

  • Set Initial memory pool and Maximum memory pool to 1024MB for server with 2GB of RAM this will be enough

  • Add next java options to existing:

    -Dspring.config.name=termweb -Dspring.profiles.active=mysql,termweb3-search -Dfile.encoding=UTF-8 -Duser.timezone=UTC -Dtermweb.home=C:\twhome -verbose:gc

     

Create TermWeb home folder

On previous step we pointed in Tomcat configuration TermWeb home folder as C:\twhome so lets create it.

Configure launch of TermWeb with operating system startup

  • Change startup type to Automatic or Automatic (Delayed Start)

6

Install and configure IIS

Open server manager and add new server roles:

Add latest versions of URL Rewrite and Application Request routing modules via Web Platform Installer from IIS Manager of website:

 

Open ports 80 and 443 in Windows Firewall for any incoming connections in case if it not opened.


Open Internet Information Services (IIS) Manager and configure Default Web Site:

Site name: winsetup.termweb.eu Physical path: C:\inetpub\wwwroot\ Host name: winsetup.termweb.eu Binding type: http

 

7

Configure IIS to proxy Tomcat

Enable proxy for server

Open Application Request Routing Cache for server by double clicking:

 

Open Server Proxy Settings and tick on Enable proxy, other settings may remain with default values:

Setup rewrite rules

You can do it manually by editing URL Rewrite table for website:

But we suggest to put file web.config to root folder of web site (C:\inetpub\wwwroot).

 

8

Configure encryption for your website

Pickup certificate from your IT department or get from any company. One of non commercial companies provides it for free: https://letsencrypt.org

9

Install TermWeb 4

Unpack distributive

Create and configure termweb.properties

  • Create and open for editing the unit file by running this command:
    C:\twhome\termweb.properties

  • To be able to start successfully TermWeb you need to configure at least this properties:

Run and test

  • Restart IIS to see website
    Start tomcat, first launch will take about 2-5 minutes to create everything in database:
    Check tomcat logs for errors in file C:\tomcat\logs\catalina.out

  • Login as administrator with default credentials (default credentials can be found in a file <termweb.home>/initial.conf)

10

Configure log rotation for Tomcat

To avoid tomcat logs grow without limits we need to configure logrotate for it. Major log file to rotate there is <tomcat_folder>/logs/catalina.out

11

Configure Monitoring for server status

We advise to configure tools on your choice which will monitor server status

12

Configure DB backups

Don’t forget to have DB backups on daily basis for example.