Git Product home page Git Product logo

hellotomcat's Introduction

HelloTomcat

Requirements

  1. Java 17
  2. Maven
  3. Apache Tomcat v10

Building the webapp

You can build the webapp with the command

mvn clean package

Deploying the webapp to Tomcat

You can set the CATALINA_HOME environment variable to the location of Tomcat.

The contents of $CATALINA_HOME should look like this:

% ls $CATALINA_HOME
BUILDING.txt	CONTRIBUTING.md	bin		conf		lib		logs		temp		webapps		work

Navigate to the root directory of HelloTomcat, where pom.xml is located. Now run the command:

cp target/HelloTomcat.war $CATALINA_HOME/webapps

Starting Tomcat

You can start Tomcat by navigating to the location of Tomcat, $CATALINA_HOME, and running the command:

bin/startup.sh

This should expand the HelloTomcat.war file which is saved in the webapps folder.

Stopping Tomcat

You can stop Tomcat by navigating to $CATALINA_HOME and running the command:

bin/shutdown.sh

Running and using the webapp

After starting Tomcat, point your browser to http://localhost:8080/HelloTomcat and you'll see the index page.

You can also point your browser to http://localhost:8080/HelloTomcat/hello and see the response by the servlet.

Notes on Tomcat

Tomcat requires zero configuration. You just run bin/startup.sh and drop your war file in the webapps folder.

You can get more functionality from Tomcat by creating an admin or manager user.

At the end of the file $CATALINA_HOME/conf/tomcat-users.xml, you can add the line

<user username="tomcat" password="yourpassword" roles="manager-gui,admin-gui"/>

With Tomcat started, point your browser to http://localhost/manager. You can log in with the username "tomcat" and the password of your choice.

In the manager GUI, you should be able to see and manage all of your webapps, including HelloTomcat.

hellotomcat's People

Contributors

ataylor89 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.