Cloud Studio IDE(云开发平台)是一套构建基于 Web 的云端 IDE,具备良好的多语言开发能力,并且具有与本地 VSCode 一样的开发体验,用户可以通过浏览器访问Cloud Studio,无需在本地计算机上安装或配置开发环境。Cloud Studio IDE是第三方提供商运营的,用户通常不需要自己安装或搭建整个平台。你可以通过注册账户并登录来使用这些服务。
注册链接:https://g-udss3515.coding.net/login?redirect=%2F
centos:CentOS Linux release 8.5.2111
vscode:code-server-4.95.3-linux-amd64.tar.gz
1、搭建一个类似的:Web版VSCode
下载地址:https://github.com/coder/code-server/releases/tag/v4.95.3
# 防火墙配置:
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
tar -xvf code-server-4.95.3-linux-amd64.tar.gz
cd code-server-4.95.3-linux-amd64/bin
# 启动:
./code-server #会生成一个config.yaml文件
# 配置密码和开放端口:
vi /root/.config/code-server/config.yaml
bind-addr: 127.0.0.1:8080 # 记得改成当前服务器的ip地址
auth: password # 密码认证
password: 密码 # 密码
cert: false
开机自启动:
cat << eof > /etc/systemd/system/code-server.service
[Unit]
Description=code-server
After=network.target
[Service]
Type=exec
ExecStart=/root/code-server-4.95.3-linux-amd64/bin/code-server
Restart=always
[Install]
WantedBy=default.target
eof
systemctl start code-server
systemctl enable code-server
2、nginx反向代理
安装:yum install nginx -y
echo "192.168.10.12 www.ppyython.cn" >> /etc/hosts
# win上配置:C:\Windows\System32\drivers\etc\hosts
192.168.10.12 www.ppyython.cn
vi /etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf; # 默认配置,不用修改
server {
server_name www.ppyython.cn;
}
vi /etc/nginx/conf.d/code-server.conf
server {
listen 80;
server_name www.ppyython.cn;
location / {
proxy_pass http://192.168.10.12:8080/;
# 代理WebSocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
systemctl start nginx
systemctl enable nginx