Home > Article > Operation and Maintenance > What to do if Linux cannot access
What should I do if Linux cannot access it? Linux HTTP service cannot be accessed
I used nodejs to create an HTTP service (port 8080) on the Linux server. The result was that it could only be accessed locally. I immediately suspected that it was a problem with the Linux access control file. The operation process As follows:
1. Open the access control file iptables
#vi /etc/sysconfig/iptables
2. Find the developed port content, hit yy to copy a copy, and then hit p to paste. The following content will probably appear
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
3. Move the mouse to jump to the port number 443, hit i, and change 443 to the port number you need, such as 8080, as follows
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
4. After the modification is completed, press the ESC key , enter: wq to save the file
5. Restart the access control service
# /etc/init.d/iptables restart
The operation is completed. Now all machines can access the HTTP service of the Linux server.
Recommended: "Linux Tutorial"
The above is the detailed content of What to do if Linux cannot access. For more information, please follow other related articles on the PHP Chinese website!