简体   繁体   中英

How to copy my .war file to EC2 instance on AWS?

I have created Java Web Application that is running on Apache Tomcat. Now, I need to upload it on a remote server. I want to use AWS. I'm new to AWS. I created EC2 instance and copy my .war file to it using this command:

scp -i mykey.pem /Path/to/my/app.war  ec2-user@ec2-54-187-202-41.us-west-2.compute.amazonaws.com:/var/www/html/

the file is copied to the /var/www/html/. However, when I tried to access the website content it doesn't show my app content, it downloads the .war file to local machine in downloads folder. Could anyone told me what is wrong? How I can run my web application on EC2?

一种简单的方法是:

Copy the war file to (TOMCAT_HOME/webapps/) folder and restart Tomcat . 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM