How to upload a lib for Tomcat in Amazon EC2?

0 votes

I want to upload a lib to my Tomcat folder (in an EC2 instance). What i have done is:

scp -r -i /home/path_to_key/key.pem /home/path_to_file/file.jar ec2-user@my_address.compute.amazonaws.com:/home/ec2-user

This works perfectly only if I upload files in the "user" folder. But when i try to to upload a file in /opt/tomcat7/lib/ ? I receive this error:

scp: /opt/tomcat7/lib/file.jar: Permission denied

Any suggestions as to what i should do?

Aug 20, 2018 in AWS by datageek
• 2,430 points
30 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You need to set the proper privileges so that the ec2-user can write to the target directory. Try executing these two commands:

id

sudo ls -al /opt/tomcat7

Based on the error that you are getting i think the proper thing to do would be to add the ec2-user to the "tomcat7" group, then grant that group write access to the directory:

sudo usermod -a -G tomcat7 ec2-user sudo chmod -R g+w /opt/tomcat7

answered Aug 20, 2018 by Archana
• 4,090 points

Related Questions In AWS

0 votes
3 answers
0 votes
1 answer

In Amazon Data Pipeline, how to make sure only once instance of a pipeline is running at any time?

On the CopyTablesActivity, you could set a lateAfterTimeout attribute ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 56,140 points
153 views
0 votes
1 answer

How to upload an object into Amazon S3 in Lambda?

I suspect you are calling the context.done() function before s3.upload() has ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,090 points
28 views
0 votes
1 answer

How to restore a cluster from backup in Amazon Redshift

Amazon Redshift replicates all your data within ...READ MORE

answered Sep 28, 2018 in AWS by Archana
• 4,090 points
137 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How to upload a file to Amazon S3 without passing it my server?

This article pretty much explains the entire ...READ MORE

answered Aug 14, 2018 in AWS by Archana
• 4,090 points
40 views
0 votes
1 answer

How to set up a SPF(Sender Policy Framework) for AWS EC2 instance?

Setting up a SPF record is pretty ...READ MORE

answered Aug 16, 2018 in AWS by Archana
• 4,090 points
118 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.