赞
踩
花费22元 买了腾讯的轻量2H2G40G
先安装了宝塔,现在
项目地址
https://github.com/coder/code-server/releases
随便找一个加速站
- https://ghproxy.com
- https://gh.api.99988866.xyz
获取到加速地址
wget -c https://gh.api.99988866.xyz/https://github.com/coder/code-server/releases/download/v4.0.1/code-server-4.0.1-amd64.rpm
安装
- yum localinstall code-server-4.0.1-amd64.rpm
- #启动
- sudo systemctl enable --now code-server@$USER
提示配置文件在 info Wrote default config file to ~/.config/code-server/config.yaml
nano ~/.config/code-server/config.yaml
新版好像不可以通过http+密码的方式明文远程访问,因为域名还在备案迁移所以无法申请证书,所以暂时用ssh加密隧道来
- #去掉密码访问
- sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
- #重启
- sudo systemctl restart code-server@$USER
- #在本机上搭建隧道代理
- ssh -N -L 8080:127.0.0.1:8080 root@vps的ip
- #在本机访问
- http://127.0.0.1:8080
后来发现 可以不迁移备案直接访问,于是
在宝塔建站点,并创建数字证书,并使用cf的dns验证 把cf的密钥也给宝塔。
在站点的反向代理中,添加 配置代理,并在配置文件中添加。
- proxy_set_header Host $host;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection upgrade;
- proxy_set_header Accept-Encoding gzip;
然后
- nano ~/.config/code-server/config.yaml
- #把验证的地方 改为 password,不然就公开了
-
- systemctl start code-server@root
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。