GTAS icon indicating copy to clipboard operation
GTAS copied to clipboard

New Installation Instructions for Core GTAS on a Virtual Machine

Open dje04001 opened this issue 4 years ago • 2 comments

How to Install core GTAS in a VirtualBox Virtual Machine Running CentOS 7

A video deomonstrating how to install core GTAS is available on YouTube at the link below.

https://youtu.be/Jj1WeVz5Cpo

Requirements

Software

  • VirtualBox
  • CentOS-7-x86_64-DVD-1810.iso ( https://drive.google.com/drive/folders/1iKvAzWHzZCkZxReaMGL0vyjJW8k-67FX ) . This .iso file is 4GB
  • Modern web browser (No Internet Explorer)

Additional Hardware Requirements for Virtual Machine (Minimum)

  • 4 GB RAM for core GTAS application. More RAM is needed for ELK stack and Neo4j
  • 14 GB disk space

Other

  • The open internet

Installation

Step 1: Create Virtual Machine and Install CentOS 7

  • Download the CentOS-7-x86_64-DVD-1810.iso if you haven't already
  • Start VirtualBox application
  • Click "New" in Oracle VM VirtualBox Manager
  • Name your virtual machine. If you include CentOS it will automatically change to RedHat Linux (64-bit). It is probably the best choice since CentOS was derived from RHEL
  • Click Continue
  • Adjust RAM greater than or equal to 4GB and click "Continue"
  • Select "Create virtual hard disk now" (default) and click "Create"
  • Select "VDI (VirtualBox Disk Images)" and click Continue
  • Select "Fixed size" (this is a preference, not a requirement) and click "Continue"
  • Adjust disk space greater than or equal to 14GB and click "Create"
  • Click "Settings" in the Oracle VM VirtualBox Manager
  • Click "Display" and increase Video Memory to the maximum
  • Click "Storage" and select the "Empty" disk under "Controller: IDE"
  • Click the disk icon on the right of "Optical Drive:" under "Attributes"
  • Select "choose a disk file" from the dropdown menu and select CentOS-7-x86_64-DVD-1810.iso and click "OK"
  • Click "Start" in Oracle VM VirtualBox Manager to start virtual machine
  • Wizard should default to the .iso selected previously. Click "Start"
  • Select Install CentOS7 and press return
  • Adjust screen size in menubar if necessary View>Virtual Screen 1>
  • Select "SOFTWARE SELECTION" in "INSTALLATION SUMMARY" window
  • in "Base Environment" select "GNOME Desktop" (other Add-Ons for Selected Environment are preferences, not requirements) and click "Done"
  • Select "INSTALLATION DESTINATION" and click "Done"
  • Select "NETWORK & HOST NAME" and click toggle next to "Ethernet" and click "Done"
  • Click "Begin Installation"
  • Click "ROOT PASSWORD" to set root password and click "Done"
  • Click "USER CREATION" to create other users and click "Done"
  • Wait for installation to complete and click "Reboot"
  • Accept the License and click "Done"
  • Click "FINISH CONFIGURATION"

Step 2: Install VirtualBox Guest Additions and Enable File Sharing

  • Login as root under "Not listed?"
  • Click "Devices>Insert Guest Additions CD Image" in menubar of Host Machine
  • Click Run in wizard window to run installation script
  • When prompted, press Return to close the window
  • Devices>Shard Folders>Shared Folder Settings
  • Click the "Add a folder" icon and select a path to the folder you want to share between your Host and your Virtual Machine. Select "Auto-mount" and "Make Permanent" and click "OK". Then Click "OK" on the next window
  • The "sf_Desktop" drive should be visible on your Virtual Machine desktop
  • Select Devices>Shared Clipboard>Bidirectional (preference, not requirement)
  • Select Devices>Drag and Drop>Bidirectional (preference, not requirement)
  • On the Oracle VirtualBox Manager, right click the VM and select close>Power Off and click "Power Off" in the popup.
  • On the Oracle VirtualBox Manager, right click the VM and select Start>Normal Start (for bidirectional clipboard/drag and drop changes to take effect)

Step 3 : Install Oracle Java SE Development Kit 8u202

This will require registering as a user with Oracle. It's free.

  • Open FireFox and copy this link into the address bar to navigate to Oracle's download page. https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

  • Download the jdk-8u202-linux-x64.rpm

  • you will need to be logged in as root or use sudo to install java

  • move it to the /opt directory by opening Terminal (right click on desktop) and running mv ~/Downloads/jdk-8u202-linux-x64.rpm /opt

  • Go to /opt directory cd /opt/

  • Run local install command yum localinstall jdk-8u202-linux-x64.rpm

  • Type "y" when prompted in the installation wizard

  • Run alternatives command alternatives --config java

  • Select the correct number option for 8u202

  • Check version by running the command java -version

Step 4: Install Apache Maven

  • In the terminal, use the wget command to download Apache Maven wget https://us.mirrors.quenda.co/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
  • Expand and install tar -xzvf apache-maven-3.6.3-bin.tar.gz
  • Give ownership to the user chown -R root:root /opt/apache-maven-3.6.3/
  • Add Maven to your paths echo 'export PATH=$PATH:/opt/apache-maven-3.6.3/bin' | sudo tee -a /etc/profile
  • Refresh profile to enforce changes cd /etc/ . profile
  • Change working directory back to /opt and check version to confirm installation and cd /opt/ mvn -version
  • Check paths to ensure /opt/apache-maven-3.6.3/bin is there echo $PATH

Step 5: Install Apache ActiveMQ

  • In the terminal, use the wget command to download Apache ActiveMQ wget http://archive.apache.org/dist/activemq/5.16.0/apache-activemq-5.16.0-bin.tar.gz
  • Expand and install tar -xzvf apache-activemq-5.16.0-bin.tar.gz
  • Start ActiveMQ ./apache-activemq-5.16.0/bin/activemq start
  • Confirm installation and status by viewing in web browser http://localhost:8161/admin

user: admin password: admin

Step 6: Install Apache Tomcat

  • In the terminal, use the wget command to download Apache Tomcat wget http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz
  • Expand and install tar -xzvf apache-tomcat-9.0.37.tar.gz

Step 7: Install MariaDB Client and Server

  • update yum repositories sudo yum -y update
  • modify MariaDB repo to select correct versions for GTAS use sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF
  • Copy and paste all of this text into the document editor and press "return"
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
  • Update the cache sudo yum makecache fast
  • Download and install MariaDB server and client software sudo yum -y install MariaDB-server MariaDB-client
  • Enable MariaDB as a service sudo systemctl enable --now mariadb
  • Configure MariaDB installation sudo mysql_secure_installation
  • Follow the prompts. Configure to suit your preferences

Step 8: Install GTAS from Source Code on GitHub

  • Download the source code git clone --branch dev --single-branch https://github.com/US-CBP/GTAS.git

  • To create the GTAS database, navigate to gtas-commons cd GTAS/gtas-parent/gtas-commons/

  • Run the following command mvn clean install

  • Run each of these commands sequentially, after the previous is successful mvn hibernate:update mvn hibernate:drop mvn hibernate:create

  • check for creation of database and table population mysql -u root -p

  • enter password from MaraiDB configuration

  • Select GTAS database use gtas;

  • check tables show tables;

  • check user table select * from user;

  • To compile .war files from source code, navigate to the gtas-parent directory cd /opt/GTAS/gtas-parent/

  • Run clean install command mvn clean install

  • Copy .war files and application.configuration file to the tomcat server cp /opt/GTAS/gtas-parent/gtas-job-scheduler-war/target/gtas-job-scheduler.war /opt/apache-tomcat-9.0.37/webapps/ cp /opt/GTAS/gtas-parent/gtas-webapp/target/gtas.war /opt/apache-tomcat-9.0.37/webapps/ cp /opt/GTAS/gtas-parent/gtas-commons/src/main/resources/default.application.properties /opt/apache-tomcat-9.0.37/conf/application.properties

  • Create directories for messages. The best place for them is in the Host/Virutal Machine shared directory mkdir /media/sf_Desktop/in mkdir /media/sf_Desktop/working mkdir /media/sf_Desktop/out mkdir /media/sf_Desktop/error

  • Change the directory addresses in "application.properties" for the file loader to match the directories made vim /opt/apache-tomcat-9.0.37/conf/application.properties

press "i" to insert make required edits to the doc press "esc" to stop press ":" to enter prompt type "wq" and press "enter" to write and quit

  • change the directory addresses for the file loader to match the directories made (i.e. message.dir.origin=/media/sf_Desktop/in )
message.dir.origin=/media/sf_Desktop/in
message.dir.working=/media/sf_Desktop/working
message.dir.processed=/media/sf_Desktop/out
message.dir.error=/media/sf_Desktop/error
  • To start the server, enter the command /opt/apache-tomcat-9.0.37/bin/catalina.sh run
  • You can now access the GTAS webapp by opening a browser and navigating to: http://localhost:8080/gtas/login.html username: admin password: password

Step 9 Optional: Forward ports to access GTAS on Host Machine

  • In the CentOS user interface, in the menu bar, go to firewall settings: Applications>Sundry>Firewall

  • configuration permanent add 8080

  • configuration runtime add 8080

  • on Oracle VM VirtualBox Manager go to the menu bar on the Host Machine: Network>Advanced>Port Forwarding

  • Add a rule

Name: webapp Protocol: TCP Host IP: 127.0.0.1 Host Port: 8080 Guest IP: 10.0.2.15 Guest Port: 8080

  • Access the web application on your host machine at the address: http://127.0.0.1:8080/gtas/login.html username: admin password: password

dje04001 avatar Jul 21 '20 14:07 dje04001

The GTAS build process (step 8) requires the MySQL root user to have the password "admin" otherwise it'll fail. I'd recommend adding it to the guidance above.

mfscripts avatar Apr 30 '21 10:04 mfscripts

Apache maven link is broker.

you can use this: https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

AlanMFortunaR avatar Sep 28 '23 12:09 AlanMFortunaR