最近在服务器上部署了code-server,记录下部署过程。
部署
服务器使用debian10,不建议使用centos7(软件陈旧),centos8(即将停止支持),配置2核4G。
下载对应版本链接https://github.com/cdr/code-server/releases。
使用dpkg -i命令安装,安装gcc,gdb,default-jdk,python3作为开发环境。
使用screen命令使ssh在中断连接后仍能运行在后台。
screen -S code 创建新线程。
ctrl+a, ctrl+d关闭。
screen -r返回。
启动code-server,命令:export PASSWORD=”密码” && code-server –host 0.0.0.0 –port 端口号
效果图
提升体验
补全功能通过在服务器上安装kite及插件。
配置反向代理(宝塔工具)(Nginx)
location / {
proxy_pass http://127.0.0.1:端口号;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection