zoukankan      html  css  js  c++  java
  • oneinstack 设置远程访问,将端口对外开放

    对于mysql数据库,redis数据库等需要开通远程访问的按照如下操作

    例如:

     1.打开iptables 3306端口

    iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
    service iptables save #保存iptables规则

     2.打开iptables 6379端口

    iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT
    service iptables save #保存iptables规则

    -----------------------------------------------------------------------------------
    如果出现以下二种情况
    iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT   指令报错 :iptables: Index of insertion too big.
    service iptables save   指令报错 : The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

     解决方案 :

      1.安装或更新服务  yum install iptables-services 

      2.启动iptables     systemctl enable iptables 

      3.打开iptable    systemctl start iptables 

      4.最后执行     service iptables save

      5.重启          service iptables restart

     

    卸载 (oneinstack自带的和新安装的iptables-services )

    yum remove iptables 

    yum remove iptables-services 

       最后需要注意的是服务器的防火墙策略也需要添加相应的端口

     
  • 相关阅读:
    Document
    Echarts 图例交互事件,及使用
    Echarts 入门之基础使用(部份 API)
    对比 continue、break 在循环中的作用
    Markdown 简要语法速成
    CSS 实现必填项前/后添加红色*、√、X、▲
    9.React Context 上下文
    [leetcode sort]179. Largest Number
    [leetcode tree]102. Binary Tree Level Order Traversal
    [leetcode tree]101. Symmetric Tree
  • 原文地址:https://www.cnblogs.com/SeaWxx/p/12698462.html
Copyright © 2011-2022 走看看