When I was setting up a server environment in Linux, I encountered a problem. I would like to share it with you here. Let’s go and see it together!
Problem description: I built a tomcat server in Linux. After starting tomcat, I found that the tomcat could not be accessed on the LAN browser. The browser reported an inaccessible server error. I checked the tomcat log and the path.... /tomcat/logs/catalina.out, it was found that tomcat did not report an error during the startup process. I checked the project log again and there were no errors.
Solution: Searching the Internet, I found that many people have encountered this problem. This is caused by turning on the Linux firewall. Most of the online methods are to start and stop through the following instructions
service iptables stop search #stop
chkconfig iptables off #disable
However, because the Linux system I installed is centos 7, the above two instructions cannot be executed in Linux, and the following error is reported:
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
In different Linux systems, the operation instructions are generally the same, but there will still be subtle differences in different systems. We often use red hat. For red hat, the above two stop and disable methods 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 #stop
systemctl disable firewalld.service #disable
The above is the detailed content of How to solve the problem that the LAN browser cannot access the tomcat service in Linux after it is released. For more information, please follow other related articles on the PHP Chinese website!