< OS 有关 > 阿里云:轻量应用服务器 的使用 安装 Tailscale 后DNS 出错, 修复并替换 apt 数据源

VPS 配置

  • 主机:vCPU x2,  512MB, 20GB
  • 位置:阿里云,日本.东京
  • OS: ubuntu24.20

原因:

这篇是操作过程的记录文章。

2 个月前, 在阿里云买了台 vps 。当时本想放到韩国,因为它离北京近。 但最便宜的这款没货。就选择了日本。

我不喜欢 Unix/Linux 还弄个 sudo,碍事。没办法,可用的就这些,内存只有0.5GB。 Ubuntu

拿到 VPS 阿里云 轻量应用服务器

删除 法语包 :p

rm -fr /      # 别真做

玩笑~

一、先升级软件包的数据库:

1. 更新可用软件包的数据库

:~$ sudo apt-get update
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease [256 kB]
2025-01-10 15:30:08 重新连接成功!
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-40-generic x86_64)
...
Welcome to Alibaba Cloud Elastic Compute Service !
Last login: Sat Jan 11 05:30:07 2025 from 

2. 升级系统中所有已安装的软件包到最新版本

~$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:python3-boto3 python3-botocore python3-dateutil python3-jmespath python3-packaging python3-s3transfer
...
User sessions running outdated binaries:admin @ session #36: apt[8408], sshd[8342,8388]admin @ user manager service: systemd[8263]No VM guests are running outdated hypervisor (qemu) binaries on this host.
N: Some packages may have been kept back due to phasing.

3. 安装 curl 和 git 这两个软件包 (如果已经安装,会进行升级)

~$ sudo apt install -y curl git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (8.5.0-2ubuntu10.6).
git is already the newest version (1:2.43.0-1ubuntu7.1).
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

小结:上图看到 apt 数据源是 aliyuncs.com 

二、安装 tailscale

1. 安装指引:

信息源: Download | Tailscale 指导

2. 安装步骤:

选平台的 OS: Linux, 然后复制 “命令” 行,到 vpm console 里运行。 看到成功后,再运行:

"sudo tailscale up"

按提示,把上面的绿框,复制到浏览器去激活。

成功后,到控制台,就可以看到 vLan 中的设备, 见下图中的绿框, Linux 也会返回 "Success"

三、替换 apt 数据源

1. 原因:在更新系统时,报错

root@i---Z:~# sudo apt update && sudo apt upgrade -y
Last login: Fri Jan 17 09:06:30 2025 from 15.181.96.144
root@iZ6we8yqtf6a6ziq6lzoggZ:~# sudo apt update && sudo apt upgrade -y
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease                  
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease                  
Ign:3 http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates InRelease
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Ign:4 http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports InRelease
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Ign:5 http://mirrors.cloud.aliyuncs.com/ubuntu noble-security InRelease
Err:2 https://pkgs.tailscale.com/stable/ubuntu noble InReleaseCould not resolve 'pkgs.tailscale.com'
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease
Ign:3 http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates InRelease
Ign:4 http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports InRelease
Ign:5 http://mirrors.cloud.aliyuncs.com/ubuntu noble-security InRelease
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease
0% [Working]

在安装 Tailscale 后,遇到 DNS 解析问题

# ping google.com
ping: google.com: Name or service not known

2. 修复 DNS

1) 查看 /etc/resolv.conf
cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
search tailcd75d4.ts.net

原本以为修改 nameserver 就可以,但不是这样。 从上面可以看到,配置文件中,Tailscale 添加的搜索域:search tailcd75d4.ts.net 
不是常规的,来修改 resolv.conf 

2) Tailscale 网络配置
检查 Tailscale 的状态

查看当前 DNS 配置

3)利用 netplan 配置系统 DNS

创建配置文件:

cat << EOF >> /etc/netplan/00-installer-config.yaml
network:version: 2ethernets:eth0:dhcp4: truenameservers:addresses: [223.5.5.5, 223.6.6.6]
EOF

上面的地址是 阿里云 的DNS

应用配置:

# sudo netplan apply(generate:190382): WARNING : 05:43:44.708: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.(process:190378): WARNING : 05:43:45.676: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.(process:190378): WARNING : 05:43:46.044: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.

这个报错是 netplan 配置文件权限太开放,要修改:文件权限、所有者

sudo chmod 600 /etc/netplan/00-installer-config.yaml
sudo chown root:root /etc/netplan/00-installer-config.yaml

再次应用配置:

sudo netplan apply

检查配置是否生效:

ping google.com 可以解析, DNS 问题算是解决。

4)  使用日本 apt 源

更新时,连不到 阿里云的镜像, 有问题,切换到日本的镜像源

a.  cat /etc/apt/sources.list
root@---Z:~# cat /etc/apt/sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble main restricted## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates main restricted## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates universe## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble multiverse
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates multiverse## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports main restricted universe multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports main restricted universe multiversedeb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security main restricted
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security multiverse

依据注释的方法:在 /etc/apt/sources.list.d/ 创建新的源文件,添加内容见下图:

b. 禁用阿里云
对源文件备份:
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
创建新的 sources.list
root@i----Z:~# cat /etc/apt/sources.list
deb http://jp.archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
清除缓存并尝试更新
sudo apt clean
sudo apt update && sudo apt upgrade -y
便宜没好货,等了几分钟没动

c. 改 systemd-resolved 配置 /etc/systemd/resolved.conf
# cat /etc/systemd/resolved.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file (or a copy of it placed in
# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
# the /etc/systemd/resolved.conf.d/ directory. The latter is generally
# recommended. Defaults can be restored by simply deleting the main
# configuration file and all drop-ins located in /etc/.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=8.8.8.8 8.8.8.4
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0

加了 GOOGLE DNS IP, 去掉注释 DNSStubListener=yes

重启 systemd-resolved:
sudo systemctl restart systemd-resolved
检查是否生效
root@i----Z:~# resolvectl status
GlobalProtocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupportedresolv.conf mode: stub
Current DNS Server: 8.8.8.8DNS Servers: 8.8.8.8 8.8.8.4Link 2 (eth0)Current Scopes: DNSProtocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 223.5.5.5DNS Servers: 223.5.5.5 223.6.6.6 100.100.2.136 100.100.2.138Link 3 (tailscale0)Current Scopes: DNSProtocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 100.100.100.100DNS Servers: 100.100.100.100DNS Domain: tailcd75d4.ts.net ~0.e.1.a.c.5.1.1.a.7.d.f.ip6.arpa ~100.100.in-addr.arpa ~101.100.in-addr.arpa ~102.100.in-addr.arpa ~103.100.in-addr.arpa ~104.100.in-addr.arpa ~105.100.in-addr.arpa ~106.100.in-addr.arpa ~107.100.in-addr.arpa~108.100.in-addr.arpa ~109.100.in-addr.arpa ~110.100.in-addr.arpa ~111.100.in-addr.arpa ~112.100.in-addr.arpa ~113.100.in-addr.arpa ~114.100.in-addr.arpa ~115.100.in-addr.arpa ~116.100.in-addr.arpa ~117.100.in-addr.arpa~118.100.in-addr.arpa ~119.100.in-addr.arpa ~120.100.in-addr.arpa ~121.100.in-addr.arpa ~122.100.in-addr.arpa ~123.100.in-addr.arpa ~124.100.in-addr.arpa ~125.100.in-addr.arpa ~126.100.in-addr.arpa ~127.100.in-addr.arpa~64.100.in-addr.arpa ~65.100.in-addr.arpa ~66.100.in-addr.arpa ~67.100.in-addr.arpa ~68.100.in-addr.arpa ~69.100.in-addr.arpa ~70.100.in-addr.arpa ~71.100.in-addr.arpa ~72.100.in-addr.arpa ~73.100.in-addr.arpa ~74.100.in-addr.arpa~75.100.in-addr.arpa ~76.100.in-addr.arpa ~77.100.in-addr.arpa ~78.100.in-addr.arpa ~79.100.in-addr.arpa ~80.100.in-addr.arpa ~81.100.in-addr.arpa ~82.100.in-addr.arpa ~83.100.in-addr.arpa ~84.100.in-addr.arpa ~85.100.in-addr.arpa~86.100.in-addr.arpa ~87.100.in-addr.arpa ~88.100.in-addr.arpa ~89.100.in-addr.arpa ~90.100.in-addr.arpa ~91.100.in-addr.arpa ~92.100.in-addr.arpa ~93.100.in-addr.arpa ~94.100.in-addr.arpa ~95.100.in-addr.arpa ~96.100.in-addr.arpa~97.100.in-addr.arpa ~98.100.in-addr.arpa ~99.100.in-addr.arpa ~ts.net

再次尝试更新 apt
root@i----Z:~# ^C
root@i----Z:~# sudo apt update && sudo apt upgrade -y
Hit:1 http://jp.archive.ubuntu.com/ubuntu noble InRelease                                                                                                  
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease                                 
Get:3 http://jp.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]                       
Hit:4 http://jp.archive.ubuntu.com/ubuntu noble-backports InRelease
Get:5 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
0% [Working]                    

已经正常, 但 iostat 输出进一步证实了 I/O 瓶颈是系统缓慢的罪魁祸首。重启 vps

再升做了一遍, 清除缓存,安装 apt。 这次完成了。

npacking rsync (3.2.7-1ubuntu1.2) over (3.2.7-1ubuntu1) ...
Setting up rsync (3.2.7-1ubuntu1.2) ...
rsync.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.12.0-4build2) ...
Scanning processes...                                                                                 
Scanning linux images...                                                                              Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.
N: Some packages may have been kept back due to phasing.
root@i------Z:~# 
root@i-------Z:~# sudo apt update && sudo apt upgrade -y

现在这台 vps 的 DNS, APT 源不现使用 阿里云。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/893315.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

小企业品牌塑造之困-中小企实战运营和营销工作室博客

小企业品牌塑造之困-中小企实战运营和营销工作室博客 在商业的广袤天地中&#xff0c;小企业如点点繁星&#xff0c;怀揣着成长为璀璨星辰的梦想。品牌塑造&#xff0c;无疑是它们迈向成功的关键路径。然而&#xff0c;现实却布满荆棘&#xff0c;众多小企业在品牌塑造的征程中…

HTML5 Canvas和JavaScript的3D粒子星系效果

HTML部分 基本结构包括<html>, <head>, 和 <body>标签。<title>标签设置了页面标题为“优化版3D粒子星系”。<style>块定义了一些基本样式&#xff1a; body&#xff1a;无边距&#xff0c;隐藏滚动条&#xff0c;黑色背景&#xff0c;禁用触摸…

65,【5】buuctf web [SUCTF 2019]Upload Labs 2

进入靶场 1,源代码 点击题目时有个就有个admin.php <?php // 引入配置文件 include config.php;class Ad{public $cmd;public $clazz;public $func1;public $func2;public $func3;public $instance;public $arg1;public $arg2;public $arg3;// 构造函数&#xff0c;用于初…

3Dgaussian-splatting部署使用流程

gaussian-splatting 教程目录&#xff1a; 官网地址&#xff1a;https://github.com/graphdeco-inria/gaussian-splatting (https://www.bilibili.com/video/BV1Nz421o71Q/?spm_id_from333.1391.0.0&vd_source79565f57ecbfc6a2349aa6f37d4ec214) 安装前置 1.安装Git&…

BLE透传方案,IoT短距无线通信的“中坚力量”

在物联网&#xff08;IoT&#xff09;短距无线通信生态系统中&#xff0c;低功耗蓝牙&#xff08;BLE&#xff09;数据透传是一种无需任何网络或基础设施即可完成双向通信的技术。其主要通过简单操作串口的方式进行无线数据传输&#xff0c;最高能满足2Mbps的数据传输速率&…

12_PlayerPrefs存储登录窗口逻辑_回调函数优化Lamd表达式

创建 登录窗口LoginWnd.cs 绑定 登录窗口LoginWnd.cs 编写 登录窗口LoginWnd.cs using UnityEngine; using UnityEngine.UI; //输入文本 命名空间 //功能 : 登录注册窗口 public class LoginWnd : MonoBehaviour{public InputField iptAcct;public InputField iptPass;public …

西门子【Library of General Functions (LGF) for SIMATIC S7-1200 / S7-1500】

文章目录 概要整体架构流程技术名词解释技术细节小结 概要 通用函数库 (LGF) 扩展了 TIA Portal 中用于 PLC 编程的 STEP 7 指令&#xff08;数学函数、时间、计数器 等&#xff09;。该库可以不受限制地使用&#xff0c;并包含 FIFO 、搜索功能、矩阵计算、 astro 计…

每日一刷——1.20——准备蓝桥杯

链接&#xff1a;登录—专业IT笔试面试备考平台_牛客网 来源&#xff1a;牛客网 题目一 请统计某个给定范围[L, R]的所有整数中&#xff0c;数字2出现的次数。 比如给定范围[2, 22]&#xff0c;数字2在数2中出现了1次&#xff0c;在数12中出现1次&#xff0c;在数20中出现1次&a…

Cursor 与常见集成开发环境(IDE)的优势对比

Cursor与常见集成开发环境&#xff08;IDE&#xff09;的优势对比 一、AI 辅助编程能力 强大的代码生成功能&#xff1a; Cursor&#xff1a; 以其内置的强大 AI 辅助编程功能为核心优势。用户可以通过输入自然语言描述&#xff0c;快速生成各种编程语言的代码。例如&#xf…

会议签到系统的架构和实现

会议签到系统的架构和实现 摘要:通过定制安卓会议机开机APP呈现签到界面&#xff0c;并且通过W/B结构采集管理签到信息&#xff0c;实现会议签到的功能。为达到此目标本文将探讨使用Redis提供后台数据支持&#xff1b;使用SocketIo处理适时消息&#xff1b;使用Flask进行原型开…

c++ 与 Matlab 程序的数据比对

文章目录 背景环境数据保存数据加载 背景 ***避免数据精度误差&#xff0c;快速对比变量 *** 环境 c下载 https://github.com/BlueBrain/HighFive 以及hdf5库 在vs 中配置库 数据保存 #include <highfive/highfive.hpp> using namespace HighFive;std::string fil…

【go语言】go的卸载与安装

一、卸载go sudo rm -rf /usr/local/go sudo apt-get remove golang sudo apt-get remove golang-go sudo apt-get autoremove wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz sudo tar -xzf go1.19.linux-amd64.tar.gz -C /usr/local go env -w GOPROXY"http…

python3D圣诞树

import pygame import math from pygame.locals import *# 初始化Pygame pygame.init()# 设置屏幕尺寸和标题 width, height 800, 600 screen pygame.display.set_mode((width, height)) pygame.display.set_caption(3D 圣诞树)# 设置颜色 GREEN (34, 139, 34) BROWN (139,…

探索 SolidJS:一款高速的前端框架

在当今的前端开发领域&#xff0c;React、Vue 和 Angular 等框架已经占据了主流位置。然而&#xff0c;对于追求性能极致优化和简单易用性的开发者来说&#xff0c;一些新兴框架正逐渐引起关注&#xff0c;其中 SolidJS 就是一个令人瞩目的候选者。本文将带您深入探讨 SolidJS …

WPF 引发类型为“System.Windows.Forms.AxHost+InvalidActiveXStateException”的异常 解决办法

本章讲述&#xff1a;引发类型为“System.Windows.Forms.AxHostInvalidActiveXStateException”的异常 解决办法。 这几天在做一个WPF功能时&#xff0c;因为引用了第三方的OCX控件&#xff0c;一般来说一个对象只要实例化就行了, 但是在引用这个控件时就报引发类型为“System.…

Kotlin语言的数据库编程

Kotlin语言的数据库编程 引言 Kotlin是一种现代的编程语言&#xff0c;因其简洁、强大和安全性而受到广泛欢迎。自从Google宣布Kotlin成为Android开发的官方语言以来&#xff0c;它的使用范围不断扩大&#xff0c;尤其是在移动应用开发、服务器端开发和数据科学等领域。在本篇…

22. C语言 输入与输出详解

本章目录: 前言1. 输入输出的基础概念1.1 标准输入输出流1.2 输入输出函数 2. 格式化输出与输入2.1 使用 printf() 进行输出示例 1: 输出字符串示例 2: 输出整数示例 3: 输出浮点数 2.2 使用 scanf() 进行输入示例 4: 读取整数和字符改进方案&#xff1a;使用getchar()清理缓冲…

OSS使用签名URL上传(返回前端上传地址)- NodeJS

使用过程 使用PUT方式的签名URL上传文件的过程如下&#xff1a; 代码示例 文件拥有者生成PUT方法的签名URL const OSS require("ali-oss");// 获取签名URL const client await new OSS({accessKeyId: yourAccessKeyId,accessKeySecret: yourAccessKeySecret,buc…

使用 div 自定义 input 和 textarea

1. 为什么要自定义呢&#xff1f; 原生的 input 和 textarea 在某些特定场景下存在功能或兼容性限制&#xff0c;因此使用 div 元素自定义实现&#xff0c;突破原生输入框在样式、功能、兼容性上的限制。 1、解决火狐浏览器换行问题 某些版本的火狐浏览器中&#xff0c;原生…

Golang的网络编程安全

Golang的网络编程安全 一、Golang网络编程的基本概念 作为一种现代化的编程语言&#xff0c;具有优秀的并发特性和网络编程能力。在Golang中&#xff0c;网络编程是非常常见的需求&#xff0c;可以用于开发各种类型的网络应用&#xff0c;比如Web服务、API服务、消息队列等。Go…