V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
PhilFreecess
V2EX  ›  问与答

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

  •  
  •   PhilFreecess · 2018-07-13 19:45:15 +08:00 · 845 次点击
    这是一个创建于 2126 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    input2output
        1
    input2output  
       2018-07-13 19:57:44 +08:00
    添加完后需要 sudo firewall-cmd --reload 生效
    PhilFreecess
        2
    PhilFreecess  
    OP
       2018-07-13 20:03:57 +08:00
    @input2output
    输入后显示 success 了,可是用 telnet 测试还是连接失败,显示如下:
    正在连接 45.63.84.164...无法打开到主机的连接。 在端口 80: 连接失败
    input2output
        3
    input2output  
       2018-07-13 20:16:30 +08:00
    input2output
        4
    input2output  
       2018-07-13 20:20:41 +08:00
    input2output
        5
    input2output  
       2018-07-13 20:20:55 +08:00
    应该开了
    WordTian
        6
    WordTian  
       2018-07-13 20:21:02 +08:00 via Android
    你防火墙开了端口,但是你在对应的端口上启动服务了吗?🙃
    PhilFreecess
        7
    PhilFreecess  
    OP
       2018-07-13 20:32:10 +08:00
    @input2output
    可是 telnel 显示 80 端口拒绝连接那不就是用不了了吗?我买的一个域名解析到这个服务器但是打不开网页,我才觉得应该是 80 端口没有打开成功的原因。。。
    input2output
        8
    input2output  
       2018-07-13 20:35:35 +08:00
    @PhilFreecess #7 你 nginx / apache 开了吗
    input2output
        9
    input2output  
       2018-07-13 20:36:12 +08:00
    这个是服务没有开
    PhilFreecess
        10
    PhilFreecess  
    OP
       2018-07-13 20:36:44 +08:00
    @WordTian
    不是很明白...请问下怎么操作?
    ysicing
        11
    ysicing  
       2018-07-13 20:39:10 +08:00 via Android
    @PhilFreecess 80 端口有服务监听了么
    PhilFreecess
        12
    PhilFreecess  
    OP
       2018-07-13 20:44:15 +08:00
    @input2output
    了解了,看的其他的教程都没说到这个...现在可以打开了,十分感谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   6210 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:57 · PVG 10:57 · LAX 19:57 · JFK 22:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.