How to deploy Apache Tomcat on Ubuntu Server

Uncategorized

Seeking to serve your java apps from a user-friend web application? Look no further than Tomcat. Discover how to quickly install this effective app server on Ubuntu Linux.

Developer writing code. Image: Seventyfour/Adobe Stock Apache Tomcat has actually been around for a while and is still among the more popular app server and servlet containers offered. This is an open source application of several innovations from the Jarkarta EE platform and is totally free to utilize by anybody. Apache Tomcat includes session duplication, clustering, and JMX-based server monitoring and control.

SEE: Hiring kit: Back-end Designer (TechRepublic Premium)

If you’re searching for a Java app server, Apache Tomcat is what you want. I’m going to reveal you how simple Apache Tomcat is to install on Ubuntu Server.

What you’ll require to install Apache Tomcat

The only things you’ll need for this setup are a running instance of Ubuntu Server 20.04 or 22.04 and a user with sudo advantages. That’s it: Let’s get to work.

How to install Java

The very first thing we should do is install Java, specifically OpenJDK 11. To do that, log in to your Ubuntu instance and provide the command:

sudo apt-get set up openjdk-11-jdk -y

When the installation completes, confirm it with the command:

java– variation

You must see something like this in the output:

openjdk 11.0.17 2022-10-18
OpenJDK Runtime Environment (develop 11.0.17 +8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (develop 11.0.17 +8-post-Ubuntu-1ubuntu222.04, combined mode, sharing)

How to install Apache Tomcat

Luckily, there’s a version of Apache Tomcat discovered in the basic repositories. You can find out precisely which version by releasing the command:

sudo apt-cache search tomcat

The output ought to reveal that variation tomcat9 is offered, and that’s what we’ll install. To install variation 9 of Apache Tomcat, issue the command:

sudo apt-get set up tomcat9 tomcat9-admin -y

You’ll now want to open port 8080 in your firewall with the command:

sudo ufw allow from any to any port 8080 proto tcp

How to configure Apache Tomcat

We now need to configure Apache Tomcat so you can visit to the web GUI with the proper authorizations to use the admin tools. Open the setup file with:

sudo nano/ etc/tomcat9/tomcat-users. xml

Because file, you’ll see a section near the bottom that appears like this:

Modification that
section to this, where PASSWORD
is a strong and distinct password: Save and close the file. Restart Apache Tomcat with: sudo systemctl reboot tomcat9 How to access the web GUI Open a web browser and point itto http://SERVER:8080/manager/html, where SERVER is the IP address or domain of the hosting server. You will be prompted for user qualifications. Type tomcat

for the username and the password you produced in the tomcat-users. xml file. On successful authentication, you’ll be greeted by the Tomcat

Web Application Supervisor( Figure A). Figure A Tomcat has actually been effectively set up and is prepared to utilize. The sky’s the limitation With Apache Tomcat set up the sky’s the limit to what you

can do with serving your Java apps. By using this handy web-based GUI, you can begin deploying your Java apps with ease. Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the current tech recommendations for company pros from Jack Wallen. Source

Leave a Reply

Your email address will not be published. Required fields are marked *