Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Deploy-Java-Application-on-Tomcat-Server

Create a Virtual Machine on AWS

1

Connect this machine to the server using Mobaxterm and install tomcat in the /opt

1

1

Extract the tar file so that the file can be executable.

Use the command tar xvzf filename

1

Make some modifications on the configuration directory of the extracted file

1

These modifications are related to the username and password and need to be done on the tomcat-users.xml inside the cd /opt/apache-tomcat-9.0.76/conf/

1

Create alias

sudo ln -s /opt/apache-tomcat-9.0.76/bin/startup.sh /usr/bin/startTomcat sudo ln -s /opt/apache-tomcat-9.0.76/bin/shutdown.sh /usr/bin/stopTomcat

1

Open the context.xml file and comment

Inside the webapps directory, we have 2 files that need to be modified: manager and host-manager sudo vi /opt/apache-tomcat-9.0.76/webapps/manager/META-INF/context.xml

1

sudo vi /opt/apache-tomcat-9.0.76/webapps/host-manager/META-INF/context.xml

Stop the tomcat and start it again

  • install Java and maven first so that we can define the variable otherwise we will received an error message when we will try

1

For start and stop Tomcat, use sudo stopTomcat and sudo startTomcat

1

Access the tomcat application from the browser

By default Tomcat runs on 8080

1

Tomcat is running

Build our application

Clone the repository https://github.com/jaiswaladi246/Petclinic.git

-Go to cd Petclinic

1

  • apply the command mvn clean package
  • The petclinic.war file is created inside the target folder

Integrate the application in the Tomcat Server

  • Copy the complete path of the petclinic.war file with pwd
  • Go to webapps folder, run pwd and copy the path (this is our target path)
  • Go to petclinic folder and copy the target path from where the war file is located: cp /root/Petclinic/target/petclinic.war /opt/apache-tomcat-9.0.76/webapps/
  • Go to our Tomcat page and add the path of the source code in the browser: IP:8080/Petclinic Our application is running as a separate process in the tomcat server

Troubleshooting

  • We install Tomcat without installing java. we noticed an error message related to the path of Java.
  • when trying accessing Tomcat from the server, we received an error message. We discovered that the port 8080 wasn't open in the security group. We correct it

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors