This section of the guide is to setup an AWS t2micro server for use with OFBiz. I initially set it up for version 16.11, but have since used it for 18.12.
Create an AWS account and sign in at: https://aws.amazon.com/
Create IAM User Account:
Download the AWS User Guide for Linux Instances Copyright 2019: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ug.pdf
Best practices says to create an IAM user and turn on Multi-Factor Authentication.
See Page 19
When complete your dashboard should look something like this:
Login to AWS Console
Select Services Drop Down Menu
Select Compute - EC2
Select Security Groups
Edit Default Group
Select Inbound Tab
Click on Edit
Select All Traffic for all Ports from Your IP address
Click on Save
This secures the server to only your location.
Select Key Pairs
Click on Create Key Pair
Enter Key Pair Name"YourNameEtc"
Click on Create
Watch for Download pem file in Lower Left Corner
Download PuTTY: https://www.chiark.greenend.org.uk/~sgtatham/putty/
Install
Downlkoad WinSCP 5.15: https://winscp.net/eng/download.php
Install
From Putty Menu
Run PuTTYgen
Click Load NewKeyPair.pem
Click Save Private Key
Click No on Passphrase Message
Name the file NewKeyPair.ppk
From AWS Console Select Launch Image
Choose Amazon Linux AMI 2018.03.0
20220220 Update: Choose: Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type - ami-0573b70afecda915d (64-bit x86) / ami-0718e47b155c6ea59 (64-bit Arm)
Click on Select
Select t2.micro
Click on:
Next: Configure Instance Details
Use all Default Values
Click on:
Next: Add Storage
Use all Default Values
Click on:
Next: Add Tags
No Tags are Needed
Click on:
Next: Configure Security Group
Click on "Select an existing security group"
This is the firewall ports from your IP address to only access your server instance.
Click on:
Review and Launch
Review Settings
Click on:
Launch
Select Existing Key Pair
Click on: I Acknowledge box
Click on: Launch Instances
Click on:
View Instances
AWS EC2 Instance
Select Running Instance
Select the Copy Icon in the details section.
This is what you will feed into PuTTY for an SSH connection.
Past Host Name
Verify Port 22
Verify SSH is Selected
Type OFBiz Server in Saved Sessions
Click on:
Save
Click on SSH Below Connection
Click on Auth Below SSH
Click on : Browse
Select Your NewKeyPair.ppk File
Click on Data Below Connection
Enter ec2-user in Auto-login
Go back to top and Click on Session
Click on Save again.
Highly recommend visiting this site and getting your PuTTY settings right.
https://www.linux.com/tutorials/improving-putty-settings-windows/
Click on Yes
This acknowledges that the servers host key is not cached in the registry.
You are now connected to your AWS Instance via PuTTY
Type sudo yum update
Press Enter
This will apply outstanding updates to your linux server.
Type:
Old: sudo yum install java-1.8.0-openjdk-devel
20220221 Update: sudo amazon-linux-extras install java-openjdk11
Press Enter
Press y
When Prompted to Install
This will install Java 1.8.0 to your AWS server.
Type:
Old: sudo yum remove java-1.7.0
20220221 Update: Not Needed
Press Enter
Press y
When Prompted to Uninstall
This will remove Java 1.7.0 from your AWS server.
Type:
export PATH=$PATH:/usr/lib/jvm/jre/bin
This will add the path to your Java binary directory to the current system PATH environment variable.
Type:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
Press Enter
Be patient. This is creating a 1GB block device of all zero's.
Type:
sudo /sbin/mkswap /var/swap.1
Press Enter
This sets up the swap space.
Type:
sudo chmod 600 /var/swap.1
Press Enter
This sets the permissions on the /var/swap.1 device.
Type:
sudo /sbin/swapon /var/swap.1
Press Enter
This turns on the swap device.
Type:
top
Press Enter
About 5 lines down you will see Swap with the total, used, and free
Type:
q
This quits the memory display.
Type:
sudo nano /etc/fstab
Press Enter
Edit the /etc/fstab file
Arrow Down
Insert a Line
Type:
/var/swap.1 swap swap defaults 0 0
Press Control+X
Press Y
Press Enter
This will add the swap device on startup each time your reboot the server.
This completes the basic AWS server setup to work with OFBiz Version 16.11