Visual Studio Code Server 进程守护

[MD] © Sunplace,2023

1. 准备工作

1.1. 安装VS Code Server

网上千篇一律,不再赘述
参考链接:https://juejin.cn/post/6966772881552310303

1.2. 安装supervisor

参考《群辉NAS搭建Microsoft365订阅续期服务

2. 配置文件

在/etc/supervisord.conf末尾加上

[program:vscode]
command=/bin/sh code-server
directory=<vscode-server-dir>/bin
environment=ASPNETCORE_ENVIRONMENT=Production
stopsignal=INT
autostart=true
autorestart=true
startsecs=1
stderr_logfile=/var/log/vscode.err.log
stdout_logfile=/var/log/vscode.out.log

3. 重新加载supervisor

supervisorctl update
supervisorctl reload
supervisorctl start vscode

4. 启动VS Code Server

cd /usr/vscode/bin
./code-server

vsftpd搭建中的关键配置

本文最后更新于(2023-4-4 19:38:30),链接可能失效,内容可能难以复现。请注意甄别。
mkdir -p /var/www
useradd -d /var/www/ftp -s /sbin/nologin <ftpuser>
chmod -R 755 /var/www/ftp
passwd <ftpuser>
echo "/sbin/nologin" >> /etc/shells
/etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=<website_root_dir>
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=NO
userlist_deny=NO
tcp_wrappers=YES
# userlist_file=/etc/vsftpd/user_list
pasv_enable=Yes
pasv_max_port=20000
pasv_min_port=21000

nginx配置ssl证书

本文最后更新于(2023-4-3 09:46:28),链接可能失效,内容可能难以复现。请注意甄别。
server {
# 证书
listen 443 ssl ;
server_name <domain1> <domain2>;
ssl_certificate /etc/nginx/crt/<webname>.pem;
ssl_certificate_key /etc/nginx/crt/<webname>.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;

# HTTPS跳转
server {
listen 80 ;
server_name <domain1> <domain2>;
return 301 https://$server_name$request_uri;
}