PhilFreecess
V2EX  ›  问与答

请问一下关于 CentOS 端口管理的问题

  •  
  •   PhilFreecess · Jul 13, 2018 · 1228 views
    This topic created in 2890 days ago, the information mentioned may be changed or developed.

    我的 vultr 用的是 CentOS,输入 firewall-cmd --list-ports 查看后发现只有两个端口是开着的,于是我就用 firewall-cmd --zone=public --add-port=80/tcp --permanent 打开 80 端口,也显示了成功,可是在用 telnet 检测的时候却说在端口 80 连接失败,我还要做什么其他的操作吗?在网上看到说和服务器端的安全管理有关系,可是在防火墙组里添加了 80 端口也还是连接失败,新手,请大佬们指教。

    input2output
        1
    input2output  
       Jul 13, 2018
    添加完后需要 sudo firewall-cmd --reload 生效
    PhilFreecess
        2
    PhilFreecess  
    OP
       Jul 13, 2018
    @input2output
    输入后显示 success 了,可是用 telnet 测试还是连接失败,显示如下:
    正在连接 45.63.84.164...无法打开到主机的连接。 在端口 80: 连接失败
    input2output
        3
    input2output  
       Jul 13, 2018
    input2output
        4
    input2output  
       Jul 13, 2018
    input2output
        5
    input2output  
       Jul 13, 2018
    应该开了
    WordTian
        6
    WordTian  
       Jul 13, 2018 via Android
    你防火墙开了端口,但是你在对应的端口上启动服务了吗?🙃
    PhilFreecess
        7
    PhilFreecess  
    OP
       Jul 13, 2018
    @input2output
    可是 telnel 显示 80 端口拒绝连接那不就是用不了了吗?我买的一个域名解析到这个服务器但是打不开网页,我才觉得应该是 80 端口没有打开成功的原因。。。
    input2output
        8
    input2output  
       Jul 13, 2018
    @PhilFreecess #7 你 nginx / apache 开了吗
    input2output
        9
    input2output  
       Jul 13, 2018
    这个是服务没有开
    PhilFreecess
        10
    PhilFreecess  
    OP
       Jul 13, 2018
    @WordTian
    不是很明白...请问下怎么操作?
    ysicing
        11
    ysicing  
       Jul 13, 2018 via Android
    @PhilFreecess 80 端口有服务监听了么
    PhilFreecess
        12
    PhilFreecess  
    OP
       Jul 13, 2018
    @input2output
    了解了,看的其他的教程都没说到这个...现在可以打开了,十分感谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1210 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 23:35 · PVG 07:35 · LAX 16:35 · JFK 19:35
    ♥ Do have faith in what you're doing.