使用云主机时要注意的情况

使用云主机时,会发现端口被tcp6占用的情况,这时需要编辑 /etc/sysctl文件 ,在文件尾部添加配置如下:

[root@10-7-80-221 ~]# cat /etc/sysctl.conf 
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
##add my code
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipb6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
##end my code

重启云主机和服务后,使用netstat -tunlp来确认更改是否效,同时检查云主机安全设置,是否放通相应端口

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-11 12:22:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-11 12:22:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-11 12:22:01       82 阅读
  4. Python语言-面向对象

    2024-01-11 12:22:01       91 阅读

热门阅读

  1. P1643 完美数 题解

    2024-01-11 12:22:01       56 阅读
  2. sqlserver导出数据为excel再导入到另一个数据库

    2024-01-11 12:22:01       68 阅读
  3. 【Machine Learning】Other Stuff

    2024-01-11 12:22:01       44 阅读
  4. 数据结构之红黑树

    2024-01-11 12:22:01       63 阅读
  5. 深入解析 Golang 中的自旋锁

    2024-01-11 12:22:01       56 阅读
  6. Go语言中的Select:深度解析与实战案例

    2024-01-11 12:22:01       59 阅读
  7. jQuery —— ajaxForm和ajaxSubmit的用法与区别

    2024-01-11 12:22:01       63 阅读
  8. c JPEG 中MCU 的理解

    2024-01-11 12:22:01       61 阅读