0
votes

I have created a Linux VM instance in Google Compute Engine. I installed the JDK and Tomcat with the following commands using SSH.

sudo apt-get install default-jdk
sudo apt-get install tomcat8

I have a war file in my local machine. How can I move the war file from local machine to Compute Engine VM and run the war on the Tomcat server ?

1

1 Answers

0
votes

I would recommend using Storage Buckets to store files. This way you can copy the same files to different VMs.

To use google storage from command line, first you would need to install gsutil.

To copy from your local machine to a bucket:

gsutil cp *.txt gs://my-bucket

To copy from a bucket to a VM, connect to your VM and run:

gsutil cp gs://my-bucket/*.txt .

More info about cp with gsutil on this link.