Home >Operation and Maintenance >CentOS >Tomcat cannot be accessed remotely under centos

Tomcat cannot be accessed remotely under centos

王林
王林Original
2020-03-27 16:48:192600browse

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

(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

(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

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!

Statement:
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