配置应用程序操作的端口

2023年12月13日

ID 181847

如果服务器上启用了防火墙,请执行配置端口的必需步骤。

要配置应用程序的操作端口:

  1. 打开所需端口的访问权限。为此,请根据所使用的操作系统运行以下命令之一:
    • CentOS、Red Hat Enterprise Linux 或 ALT Server:

      firewall-cmd --add-port=<port>/<protocol> --permanent

    • Ubuntu:

      ufw allow <端口>

    • Debian:

      apt-get install iptables-persistent

      iptables -A INPUT -p <protocol> --dport <port> -j ACCEPT

  2. 应用更改。为此,请根据所使用的操作系统运行以下命令之一:
    • CentOS 或 Red Hat Enterprise Linux:

      firewall-cmd --reload

    • Debian:

      netfilter-persistent save

    如果您正在使用 Ubuntu OS, 将自动应用更改。

将为应用程序的操作配置端口。

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.