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 start Tomcat in Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

How to start Tomcat in Linux system, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Introduction to Tomcat: first, the concept Tomcat server is an open source lightweight Web application server, which is widely used in small and medium-sized systems and small concurrency situations, and is the first choice for developing and debugging Servlet and JSP programs.

Second, principle Tomcat structure diagram:

Tomcat main components: server Server, service Service, connector Connector, container Container. Connector Connector and container Container are the core of Tomcat.

A Container container and one or more Connector are combined together, together with some other supporting components to form a Service service, with Service services can provide external capabilities, but the survival of Service services needs an environment, that is, Server,Server components provide a living environment for the normal use of Service services, and Server components can manage one or more Service services at the same time.

Linux system starts zookeeper detailed tutorial:\ 1. Whether Tomcat starts successfully or not, enter it in the console:

1.ps-ef | grep tomcat

Command meaning: find out whether there are tomcat processes in all current processes

If anything is displayed, Tomcat starts successfully.

Otherwise, restart Tomcat

\ 2. Check whether you can access Tomcat locally from Linux and enter commands from the console:

1.wget http://localhost:8080

Command meaning: access http://localhost:8080

Otherwise, check that the Tomcat port number is correct

\ 3. Check the Tomcat startup port number Tomcat default startup port number is 8080, if you have not made any changes to the Tomcat configuration file, then there should be no problem with the input command:

1.ps-ef | grep tomcat

Command meaning: view tomcat process information

View the process number (circle the position in the picture)

Then enter the command:

1.netstat-apn | grep 4091

(note: grep is followed by the process number found in the previous step) the meaning of the command: view the port number occupied by the 4091 process.

The location of the circle in the picture is the startup port number of your Tomcat

\ 4. Check that the ip address for remote access is correct. If you can successfully access the Tomcat server locally from Linux but not from the Windows (host), first check that the remote access ip address correctly enters the command on the Liunx console:

1.ifconfig

The location in the figure is the ip address of Linux.

\ 5. Check whether the Linux firewall opens the Tomcat port number if you have not modified the Linux firewall configuration, then the Tomcat port number must have been disabled because the Linux firewall only opens port 22 by default

You need to set the firewall configuration and open the port number of Tomcat Note: there are other solutions on the Internet that say to turn off the firewall directly, this method is very undesirable.

My Linux version is CentOS 7 to open the 8080 port number, just enter the command:

1.firewall-cmd-zone=public-add-port=8080/tcp-permanent

Then restart the firewall:

Firewall-cmd reload

This is the answer to the question about how the Linux system starts Tomcat. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.

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

Development

Wechat

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

12
Report