General Description
TODO
First, ssh into server or run this locally,
D:\school\capstone\certs> ssh -i .\rover.pem ubuntu@138.49.185.129
did work on ubuntu 16 as lowest version tested and was successfuly deployed using these instructions on eucalytpus ubuntu 20
-
sudo apt update
-
sudo apt upgrade
-
sudo apt install openjdk-8-jre-headless
-- install java -
sudo apt install openjdk-8-jdk-headless
-- install javac -
sudo apt install make
-- needed to make prism -
sudo apt install gcc
-- install C compiler -
sudo apt install g++
-- install C++ compiler -
sudo apt install libcanberra-gtk-module
-
sudo useradd -m -d /opt/tomcat -U -s /bin/false tomcat
-- make new user and group tomcat and set its home to /opt/tomcat -
sudo apt install wget
-- wget for installing tomcat -
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.64/bin/apache-tomcat-9.0.64.tar.gz
-- install tomcat (note, you may have to replace to version in the url to reflect the most recent version of tomcat 9, see here https://tomcat.apache.org/download-9.cgi)- Must use tomcat 9 because that is the most recent version compatible with spring boot
-
sudo tar xzvf apache-tomcat-9.0.64.tar.gz -C /opt/tomcat --strip-components=1
-- unzip tomcat and move it to its home directory -
sudo chown -R tomcat:tomcat /opt/tomcat/
-- set ownership of the tomcat folder contents to tomcat (they are originally root as we used sudo to unpack it) -
sudo chmod -R u+x /opt/tomcat/bin
-- set permissions of tomcat bin folder (the bin contains the shell scripts to start/stop the server) -
Go into your .bashrc file and add
unset DISPLAY
to the end of the file -
sudo cp .bashrc /opt/tomcat/
-
sudo chown tomcat:tomcat /opt/tomcat/.bashrc
sudo nano /opt/tomcat/conf/tomcat-users.xml
-- optional if you want to setup an admin dashboard, see this for instructions on how: https://www.linuxshelltips.com/install-apache-tomcat-ubuntu/
-- other stuff to set up above
Note: at this point the tomcat manager should show up on at the server ip address with port 8080 (for example, http://138.49.185.129:8080/) from our local computer (see running tomcat)
Note: tomcat deploys websites from war files which are similar to jar files with a certain file structure.
-
Switch back to our normal user
- Press control+d or type
exit
to switch back to normal user - Go to your home directory (cleaner to work in here)
- Press control+d or type
-
git clone https://github.com/logan-larson/SocialVerificationWebsite.git
-- clone the project- If git is not installed, install with
sudo apt install git
- If git is not installed, install with
-
Make sure you are using java 8 and javac 8
sudo update-alternatives --config java
sudo update-alternatives --config javac
-
For java 8 you need to disable some accessibility properties for prism to work properly, this script should do that
- sudo sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-*-openjdk/accessibility.properties
-
./project-setup.sh
-- This should compile everything and deploy the website to port 8080
At this point the server should be all set up
- If not, run
./deploy-application.sh -h
script for help deploying
The tomcat manager should show up on at the server ip address with port 8080
- For example, http://138.49.185.129:8080/ from an external computer connected to uwl through cisgo
Access the website at the following url
(http://138.49.185.222:8080/SocialVerificationWebsite/)
-
./deploy-application.sh
-- this compiles the spring boot application and deploys it if given proper flags -
./update-rover.sh
-- this compiles the back end and moves it to useful locations if given proper flags
If you run into segfaults or permission errors use ls-l and sudo -u {user} bash to check permissions, in development many bugs were present due to improper installation using sudo to move files or get around permissions but then erroring as sudo set the file created/moved to be owned by root and not tomcat, so when tomcat tried to access such files it would cause errors