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

What if tomcat is not accessible in linux centOS7?

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

Share

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

The question leads to:

Install centOS7 on the virtual machine, configure Tomcat, and start successfully. But the Tomcat 8080 port cannot be accessed in the browser.

Reason:

Because CentOS 7 or RHEL 7 or Fedora, the default firewall is managed by firewalld, and firewalld is not open to port 8080, port 8080 open configuration is performed.

In versions prior to CentOs 7, iptables controlled the port of Linuxs.

After CentOS has been upgraded to 7, it is not possible to use iptables to control the port of Linuxs because Centos 7 uses firewood instead of iptables.

Solution:

1. Open port 8080 on firewalld

The command is as follows:

Firewall-cmd-zone=public-add-port=8080/tcp-permanent

Command parsing:

-- zone # scope-- add-port=8080/tcp # add port. Format: Port / communication protocol-- permanent # is in effect permanently. If this parameter is not set, it will become invalid after restart.

2. Restart the firewall

The command is as follows:

Firewall-cmd-reload

3. Open an external browser and type http://centOS IP:8080 to see the Tomcat welcome interface!

These are the details that cannot be accessed by tomcat under linux. Please pay attention to other related articles for more information.

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