Home >Operation and Maintenance >Linux Operation and Maintenance >What should I do if the LAN browser cannot access the tomcat?

What should I do if the LAN browser cannot access the tomcat?

零下一度
零下一度Original
2017-07-17 11:37:283279browse

Yesterday, when I was setting up a server environment in Linux, I encountered a problem. I would like to share it with you here.

1. First, check whether the tomcat server starts normally. Use the netstat -a command or use software such as 360 Security Guard to see the currently connected programs and open ports, or you can check the tomcat log to see if it starts normally. If it starts normally, the machine can be accessed through the browser using a local address such as 127.0.0.1.

2. If the local computer can be accessed but the remote (LAN) cannot be accessed, it is likely to be a problem with the computer firewall. Turn off the firewall that comes with Windows or configure rules in the firewall to allow tomcat communication to allow remote access.

Problem description: I built a tomcat server in Linux. After opening tomcat, I found that the tomcat could not be accessed on the LAN browser. The browser reported an Unable to access the server error. I checked Tomcat's log, path..../tomcat/logs/catalina.out, found that tomcat did not report an error during the startup process. I checked the project log again and there were no errors.

service iptables status #View firewall status

Solution: Search online and find that many people have encountered this problem. This is caused by turning on the Linux firewall. Online Most of the methods are to start and stop through the following commands

service iptables stop #停止 chkconfig iptables off #禁用

However, because the Linux system I installed is centos 7, therefore, the above two commands cannot be executed in Linux, and the error message The following error:

Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.

In different Linux systems, the operation instructions They are generally the same, but there will still be subtle differences between different systems. We often use red hat. For red hat, the above two stop and disable are available, but for centos 7 system, only the following instructions can be used to start and stop the Linux firewall.

systemctl stop firewalld.service #停止 systemctl disable firewalld.service #禁用

The above is the detailed content of What should I do if the LAN browser cannot access the tomcat?. 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