CodeGym/Java Course/Module 3. Java Professional/Deploy the first application in Tomcat

Deploy the first application in Tomcat

Available

4.1 View the list of web applications

Now let's see what web applications are installed in Tomcat by default. There are usually several of them, and the most important one for you is the Application Manager. To open it, click on the Manager App button or follow the link .

Next, you will need to log in under the user that we saw at the settings step:

If everything went well, you will see a list of installed web applications:

Tomcat Manager App 1

The left column specifies the path where the application opens. In the rightmost column, you will see commands for managing the web application: Start, Stop, Reload, Undeploy.

4.2 Deploy a test web application

Let's upload our own web application to the Tomcat web server.

It's good that GitHub just has a special demo application for this case. Download it from the link .

Then open the Manager App page in Tomcat http://localhost:8080/manager and scroll down to the Deploy section.

Tomcat Manager App 2

In it you need to specify the path to your web application (all applications have unique paths), as well as the war file of your web application. Then click the Deploy button.

If everything went well, you will see the new application in the list of web applications:

Tomcat Manager App 3

You can verify that it works by following the link: http://localhost:8080/demo

Tomcat Manager App 4

4.3 Port change

If you don't like that your webserver responds to url localhost:8080/, and you want it to open just to url localhost/, then you need to change Tomcat's port to default: to 80instead of 8080.

To do this, open the server.xml file in the conf folder .

Find the "Connector" tag where port is 8080and change it to port 80:

<Connector port="80" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

You can also change the HTTPS port from 8443to just 443.

If you change settings while Tomcat is running, don't forget to restart it.
Comments
  • Popular
  • New
  • Old
You must be signed in to leave a comment
This page doesn't have any comments yet