linux环境安装配置 Gary Wang 2023-05-15 前端 vps linux环境安装配置 更改VPS系统时间(可选开启时间同步)12rm -rf /etc/localtimeln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime NTP同步时间 协议(可选择跳过)123456789//Ubuntu/Debian系统apt-get updateapt-get install ntp ntpdate -y//CentOS/RHEL系统yum install ntp ntpdate -y//先停止NTP服务器,再更新时间service ntpd stop //停止ntp服务ntpdate us.pool.ntp.org //同步ntp时间service ntpd start //启动ntp服务 安装宝塔1234//Debianwget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh//centosyum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh 安装curl1234//ubuntu/debian系统安装 Curl 方法apt-get update -y && apt-get install curl -y //centos系统安装 Curl 方法yum update -y && yum install curl -y 系统升级1234//开机启动systemctl enable v2ray//启动systemctl start v2ray bt路由配置1234567891011121314//网站 域名 配置文件 #SSL-END后(21行左右)location /cs{ proxy_pass http://127.0.0.1:37554; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_read_timeout 300s;}//ssl配置//let`s Encrypt 免费证书 cloudflare dns配置12345//在域名供应商处填写nameserver服务指向cloudflare//配置域名或二级域名指向服务器ip 开启代理//配置 TXT类型 ssl内容//SSL/TLS选项内加密模式改为完全(如果不修改,cloudflare的ssl与服务器ssl不匹配,连接失败)// cloudflare workers123456789101112131415//管理workers//创建worker//快速编辑//内容addEventListener( "fetch", event => { let url = new URL(event.request.url); url.hostname = "test.exmple.com"; url.protocol = "https"; let request = new Request(url, event.request); event.respondWith( fetch(request) ) })