Today, I encountered some problems when opening the web service on the server for others to access. When others used ip and port access in the internal network, they could not access it. After a long time toss, I found that the port was not opened.
Understand that ports in general Linux are closed by default, and you need to open it yourself when you need to open it
Since the os used by my server is Ubuntu, here is the method under Ubuntu. Other linux should be similar, and you need to try it yourself
Under normal circumstances, iptables will be installed when ubuntu is installed, if not, install it.
The 80 in the middle is the port that needs to be opened
After completing the above command, we have completed the opening of the specified port, but if the server restarts at this time, the above rules are gone, so we need to perform a continuous operation on the rules
Here we need to install some tools to help us achieve, here we use iptables-persistent
After completing the above operations, we can permanently open the ports we need
Note: