Aws Dynamic Hosting

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Deploying a java web project

-----------------------------

->In this we are deploying a java project in aws using ec2 instance.

steps:

1.Create a EC2 instance

EC2 -> launch instance -> give name for vm -> select os(ubuntu) ->
keypair(existing or new key pair) -> security groups (initially select the launch
wizard 1) -> launch instance.

2.connect to SSH client using git bash in local machine.

->click on the instance -> connect-> SSH CLIENT later

->open git bash in the same directory where your keypair.pem file
there. later type the commands

$ chmod 400 keypair_file_name.pem

$ ec2-44-201-127-7.compute-1.amazonaws.com (optional)

$ ssh -i "keypair_filename.pem" [email protected]


1.amazonaws.com

=>After doing the above things the git bash terminal connects to the ec2
instance.

=> Later in the terminal type the commands to update the instance.

$ sudo su (super user)

$ apt-get update (updates the instance)

Installing java on instance:


----------------------------

$ sudo apt install default-jre

$ sudo apt install default-jdk

By defaulty java 11 installed

Installing Apache tomcat on instance by the help of git bash:


-------------------------------------------------------------

$ sudo su

$ apt-get install tomcat(version)

eg : apt-get install tomcat8

To start use command:


/etc/init.d/tomcat8 start

To check the status /etc/init.d/tomcat8 status

You might also like