2

Hi I have my tomcat7 installed in amazon cloud at location /usr/sbin/tomcat7 and my war file (xyz.war) is in downloads folder. How can I copy my war file into my webapps folder. I'm new bee to Linux to may be this is very simple but I'm having a hard time with it. can some please come up and give me some example.

Thanks in advance.

Sau
  • 2,109
  • 6
  • 21
  • 22

2 Answers2

15

The following is assuming you are using windows

1) Get WinSCP for transferring files to your instance

2) With WinSCP, transfer the war file (assuming the file name is sample.war) to the following location:

/home/ec2-user/sample.war 

3) Using Putty, enter the following command

sudo -s (for root access)
cp /home/ec2-user/sample.war /var/lib/tomcat7/webapps 

4) Start / Restart your tomcat with the following command

sudo service tomcat7 start (to start)
sudo service tomcat7 restart (to restart, if your tomcat has already started)

5) Verify that it has been uploaded at the following location

http://instanceURL:8080/sample
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Steve Ng
  • 1,189
  • 1
  • 13
  • 35
0

The easiest way to deploy your .war file to your Tomcat7 application server would be to use SCP to securely transfer the file to the Amazon server you have on AWS EC2. You can find more info on SCP over at Using scp to copy a file to Amazon EC2 instance?

Community
  • 1
  • 1
dlaube
  • 19
  • 2