Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the HTTP service of Linux cannot be accessed?

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What if the HTTP service of Linux is unreachable? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Using nodejs to create a HTTP service (port 8080) on the Linux server, the result can only be accessed locally. It is suspected immediately that there is a problem with the access control file of Linux. The operation process is as follows:

1. Open the access control file iptables

# vi / etc/sysconfig/iptables

two。 Find the port content developed in it, click yy to make a copy, and then click p to paste, most of which will appear as follows

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 443-j ACCEPT

3. Move the mouse to jump to the port number 443, click I, and change 443 to the port number you need, such as 8080, as follows

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 8080-j ACCEPT

4. When the modification is complete, press ESC and enter: wq to save the file

5. Restart the access control service

# / etc/init.d/iptables restart

The operation is complete, and now all machines can access the HTTP service of the Linux server.

After reading the above, have you mastered the solution to the inaccessibility of Linux's HTTP service? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report