安装依赖环境
apt update
apt install openjdk-11-jre-headless unzip
创建安装文件夹
mkdir -pv /html/zfile
安装
cd /html/zfile
wget --no-check-certificate https://c.jun6.net/ZFILE/zfile-release.war
unzip zfile-release.war && rm -rf zfile-release.war
chmod +x ./bin/*.sh
修改端口
nano WEB-INF/classes/application.properties
守护进程命令
nano /etc/systemd/system/zfile.service
输入一下内容
[Unit]
Description=zfile
After=network.target
[Service]
Type=oneshot
ExecStart=/html/zfile/bin/start.sh
ExecStop=/html/zfile/bin/stop.sh
RemainAfterExit=yes
User=root
Group=root
[Install]
WantedBy=multi-user.target
开机启动
systemctl daemon-reload
systemctl enable zfile
systemctl start zfile
设置反代
安装nginx
apt install nginx
配置反代
nano /etc/nginx/conf.d/d.conf
输入一下内容
server {
listen 0.0.0.0:80;
server_name 网站.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:端口;
# 如果您要使用本地存储策略,请将下一行注释符删除,并更改大小为理论最大>$
client_max_body_size 20000m;
}
}
设置权限
chmod -R 777 /html
重启程序
systemctl restart nginx
systemctl start zfile