Brief setup notes for Azure VM Ubuntu 18.04 on Mac OSx.
Create a private key. A public key will be created automatically for you.
ssh-keygen -t rsa
Make note of your private key password - this is used to authenticate below.
After creating your Azure Ubuntu 18.04 VM. Take note of your Public IP.
Ensure that the default SSH port is left open.
sudo ssh -i path/private_key user@public_ip
Use your private key password after connecting.
Slightly different setup than Ubuntu 14.04.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update
sudo apt install git
sudo apt install nodejs
sudo apt install npm
Note: It's recommended to download Java 11+ directly from Oracle.
It's further recommended to use the OpenJDK 11.0.2 (and avoid other options).
See: https://jdk.java.net/archive/
sudo apt-get update
wget "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz"
sudo tar -xzvf openjdk-11.0.2_linux-x64_bin.tar.gz
sudo mv jdk-11.0.2 /usr/lib/jvm/
# Config
sudo nano /etc/environment
# Add the line below
# JAVA_HOME="/usr/lib/jvm/jdk-11.0.2/"
# Config
sudo nano ~/.bashrc
# Add the lines below
# JAVA_HOME=/usr/lib/jvm/jdk-11.0.2/
# PATH=$JAVA_HOME/bin:$PATH
source ~/.bashrc
# Verify
echo $JAVA_HOME
javac --version
Tomcat:
groupadd tomcat
useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
cd /opt/
sudo wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.2/bin/apache-tomcat-9.0.2.tar.gz
tar -xzvf apache-tomcat-9.0.2.tar.gz
sudo mv apache-tomcat-9.0.2 tomcat
Then:
# Permissions
sudo chown -hR tomcat:tomcat tomcat
sudo chmod +xr tomcat/bin/
# Config
sudo nano ~/.bashrc
# Add the line below
# CATALINA_HOME=/opt/tomcat
# Config
source ~/.bashrc
# Verify
echo $CATALINA_HOME
You can now access /opt/tomcat/bin/
to execute: sudo bash startup.sh
.
Your Tomcat server will be available by default on http://YOUR_IP:8080
(note the lack of https
here).