Home > Operation and Maintenance > Linux Operation and Maintenance > What to do if Linux cannot access

What to do if Linux cannot access

藏色散人
Release: 2019-11-13 09:13:27
Original
4424 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template