• Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
xoftmade-logo xoftmade-logo
  • Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
Client Area

How to Install Tomcat on CentOS 7 with Apache Configurations

by xoftmade
October 21, 2021
CentOS

Today we are going to setup Apache Tomcat which is a Java Servlet container developed by Apache web server. Tomcat allows you to deploy Java and JSPs applications. Tomcat is also used as a web server, where you can run small to medium size websites / apps.

This article will cover commands and instructions about how to install and use the Tomcat Web Admin Manager, it will allow you to manage Tomcat and its hosts from your web browser. For this activity we are going to use a server based on centOS 7x.

To start installation use this command:

sudo yum install tomcat

This will install Tomcat and its dependencies, including Java.

There are several additional packages which many users, particularly those who are new to Tomcat, will find useful. Install them with the command:

sudo yum install tomcat-webapps tomcat-admin-webapps tomcat-docs-webapp tomcat-javadoc

This will install:

  • The Tomcat root webpage (tomcat-webapps)
  • The Tomcat Web Admin Manager (tomcat-admin-webapps)
  • The official online Tomcat documentation (tomcat-docs-webapp and tomcat-javadoc)

If your server is running Apache, stop it with the command:

sudo systemctl stop httpd

Start Tomcat with the command:

sudo systemctl start tomcat

And enable Tomcat to automatically start if the server is rebooted:

sudo systemctl enable tomcat

You can verify that Tomcat is running by visiting the URL http://example.com:8080 in a web browser. You will see the Tomcat welcome page, which includes links to the Tomcat documentation which you installed in the previous step.

Use the Tomcat Web Admin Manager

In order to use Tomcat’s web management interface, you will need to create a user. Open the tomcat-users.xml file with the command:

sudo nano /usr/share/tomcat/conf/tomcat-users.xml

Scroll down to below the line which reads <tomcat-users> and add the information for your user account:

<user username="[username]" password="[password]" roles="manager-gui,admin-gui"/>

For example, to add the user jdoe with password En4EW25eI0 this section will read:

<tomcat-users>
<user username="jdoe" password="En4EW25eI0" roles="manager-gui,admin-gui"/>

Save and exit the file. Restart the Tomcat service for the changes to take effect:

sudo systemctl restart tomcat

In a browser, visit the URL http://example.com:8080 to see the Tomcat welcome page. Click the Manager App link.

You will be prompted to log in with the username and password you created.

From this page you can stop, reload, and run diagnostics on various Java applications.

Manage Virtual Hosts

To manage virtual hosts through the Web Application Manager, scroll down and click the /host-manager link.

This will take you to the Tomcat Virtual Host Manager, where you can add and manage virtual hosts to your Tomcat server.

Tags: tomcattomcat installation
Share:

Recent Posts

  • Duplicate emails from Google/Gmail to cPanel Webmail
  • Critical cPanel & WHM Authentication Flaw Allows Remote Takeover – Patch Now
  • Now SSLs will Expire in Just 200 Days why!
  • How to disable alt-php binaries from cPanel MultiPHP Manager
  • How to enable or disable root user login in Linux Servers?

Recent Comments

No comments to show.
xoftmade-logo
P50 Plaza, 2nd Floor, Chenab Market, Susan Road, Faisalabad
+92 311 4991414

sales@xoftmade.com

Hosting
  • Managed WordPress Hosting
  • Budget Hosting
  • Business Hosting
  • Email Hosting
  • Reseller Hosting
Company
  • About
  • Blog
  • Affiliate Marketing
  • Terms of Service
  • Contact
Domains
  • Domain Search
  • Domain Pricing
  • WHOIS Lookup
Join Our Newsletter

We’ll send you news and offers.

Social Media
Facebook-f Instagram
© All Rights Reserved - Xoftmade Web Solutions