Unable to copy war file from local directory to webapps of tomcat stack in Google Cloud

1,564 views
Skip to first unread message

Yaswanth Sai

unread,
Jun 7, 2015, 1:36:38 AM6/7/15
to gce-dis...@googlegroups.com

I am doing one android application (client-Server type).

Up to now ,I installed tomcat in my system itself . So now server is my computer and client is my phone

Now I want to deploy my server components(.war file) in to tomcat stack of Google Cloud so that my application is accessible everywhere.

Used Google Cloud option, click-to-deploy tomcat stack to install tomcat on cloud.

Next thing is placing our war file in to the webapps..

I tried almost every possible way to do it..but every trail results in vain .. :/

Installed gcloud sdk ...finally placed this war file in our project(can be visible through SourceCode -> Browse )in cloud through some git ways ( not in webapps) and unable to copy it to webapps.

Tried various alterations of copy-file command but in vain because of file permission denied.

I am unable to change the permission of webapps.

Lastly i tried the filezilla , able to connect to the ip address and locate the webapps folder..but unable to place my file in that folder because of same permissions problem....tried to change the permission in that filezilla itself but it also results in vain.. :/

able to change permissions remaining folders but not this(webapps).

So finally decided take support from google through mail or phone but i am in bronze plan.So i can't take their support, We have permissions only to read the documentation and stuff.

So

Is there any one who worked on Google Cloud ,faced similar type of problem and solved it.????

or

Is there any one who knows how to change permission of webapps folder of Tomcat Stack, Google Cloud

Help me guys,I almost completed my project but this setup work is delaying my completion

Thanks in advance :)

Faizan (Google Cloud Support)

unread,
Jun 7, 2015, 5:23:21 PM6/7/15
to gce-dis...@googlegroups.com, Yaswanth Sai
Hello Yaswanth,

Tomcat /var/lib/tomcat7/webapps/ROOT directory requires root access. To work around this you can copy your .war file to /tmp directory on the GCE tomcat instance and than move the files from /tmp to your webapps directory using sudo. All the users on a GCE instance can get root access using sudo without password.

To copy the files to /tmp from you local computer you can either use gcloud compute copy-files or through secure FTP setup. You can go to this link which has steps to transfer files to GCE instance.

You can also copy your .war file in Google Cloud Storage bucket and download the file to your GCE instance using gsutil tool.

Cheers

Faizan

Yaswanth Sai

unread,
Jun 9, 2015, 12:03:10 AM6/9/15
to gce-dis...@googlegroups.com

Finally i solved the problem.

I can actually send my war file directly from the local directory to the webapps directory of tomcat stack using filezilla or using gcloud copy file but the problem which i faced is 'permission denied'.

I solved this problem by

  1. connect to the ssh terminal
  2. type sudo bash to enter root terminal
  3. now typing chmod 777 /var/lib/tomcat7/webapps/ROOT
  4. close and re-open filezilla to get this updated permissions.

previously i was unable to change the permissions because i didn't enter in to root access.

now it's done.

Special to VIjay Gadde sir for helping me to solve the problem.

Reply all
Reply to author
Forward
0 new messages