Tomcat cannot be accessed remotely under centos

王林
Release: 2020-03-27 16:48:19
Original
2556 people have browsed it

Tomcat cannot be accessed remotely under centos

Cause analysis:

Tomcat access requires port 8080, but when accessed from the outside, our firewall will intercept it, and you happen to not configure port 8080 at this time. Firewall is not turned off.

Solution:

1. First enter the following command to open the firewall configuration file

vi /etc/sysconfig/iptables
Copy after login

(Recommended tutorial: centos tutorial)

2. Find -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT, we copy this sentence to the next line

3 , change the copied content to the following

-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
Copy after login

(that is, change 22 to the port you want to open, for example: we open 8080)

4. Press the esc key to enter :wq! Save and exit

5. Restart the firewall

The command is as follows:

service iptables restart
Copy after login

Recommended related video tutorials:linux video tutorial

The above is the detailed content of Tomcat cannot be accessed remotely under centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template