zoukankan      html  css  js  c++  java
  • Linux入门学习,开启端口号

    之前买了一个阿里云Centos 7服务器,默认开启22端口和80端口,想开启其他端口号如何做

    1.开启端口号

    [root@localhost ~]# /sbin/iptables -I INPUT -p tcp --dport 端口号 -j ACCEPT

    2、保存
    [root@localhost ~]# /etc/rc.d/init.d/iptables save

    3、重启防火墙
    [root@localhost ~]# service iptables restart

    4、查看
    [root@localhost ~]# /etc/init.d/iptables status

    可能有的问题,防火墙策略都是写在/etc/sysconfig/iptables文件里面的,但是文件没有

    解决方法:

    1、随便写一条iptables命令配置个防火墙规则:如:

      iptables -P OUTPUT ACCEPT

    2、service iptables save进行保存

    3、service iptables restart

    重启之后需要添加在文件/usr/local/apache2/conf/httpd.conf 监听端口号,才能使用

  • 相关阅读:
    git command
    MySQL命令行学习
    添加react-router
    nodejs 安装出错总结
    切换分支之后,意外出现的,待提交的改变
    git diff
    git log
    搜索的技巧
    x-shell code
    css汇总
  • 原文地址:https://www.cnblogs.com/fanxingthink/p/6090181.html
Copyright © 2011-2022 走看看