Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy Tomcat and its load balancing

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following brings you how to deploy Tomcat and its Load Balancer. I hope it can bring some help to you in practical application. Load Balancer involves many things, but there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to make an answer.

One,

Tomcat profile: Tomcat is developed by Sun's software machine architect James, Tomcat Cloud Virtual Machine is a free open source Web application server, belongs to lightweight application server, is widely used in small and medium-sized systems and development access users are not many cases, is the development and debugging JSP program of choice

Generally speaking, tomcat, like apache or nginx web servers, has the ability to process html pages, but because its ability to process html is far less than apache or nginx, tomcat is usually run as a servlet and jsp container separately on the backend.

Tomcat default port runs at 8080.

Tomcat server components:

The (server) element represents the entire Catalina serviet container

(services) is a collection consisting of one or more Connectors, and an Engine that loads client requests received by all Connectors.

(Host) stands for Virtual Host, Virtual Host

A Context corresponds to a Web Application, and a Web Application consists of one or more servlets.

Multiple Virtual Hosts can be configured under (Engine), and each virtual machine has a domain name.

(Connector) A Connector listens for customer requests on a specified port, and the obtained requests are handed over to the Engine for processing, and the response is obtained from the Engine and returned to the customer.

Two,

experimental environment

Nginx Server Tomcat Server 1 Tomcat Server 2

192.168.1.1 192.168.1.2 192.168.1.3

(1) Tomcat2 server configuration method is basically the same as Tomcat1,

(2) Close the firewall

(3) Confirm whether JDK is installed and JAVA version is consistent with Tomcat1.

(4) Create/web/webapp1 directory, modify Tomcat configuration file server.xml, change website file directory to/web/webapp1/path

(5) Create index.jsp under/web/webapp1/path, change the content of index.jsp to distinguish the test page

Configure nginx server

YUM install related packages first

Then install NGINX extract and install

Configure nginx, conf

Enter the nginx configuration file

Add the following items

Test whether nginx configuration file is correct

Start nginx service

Configuring Tomcat

Take Tomcat1 for example.

Install Configuration Tomcat

start Tomcat

Creating Java Web Sites

Modify Tomcat server. XML file

The black box contains the added content.

Use the client to access http://192.168.1.2: 8080

Only Tomcat1 configuration is shown here, the second one is the same as Tomcat 1

After reading the above information on how to deploy Tomcat and its Load Balancer, if you still have anything to know, you can find out what you are interested in the industry information or find our professional technical engineers to answer. Technical engineers have more than ten years of experience in the industry.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report