
代码和数据总存在linux上。windows没有rsync不能直接断点下载太难受了,每次下载超过10个G都会一直下不下来。
sudo apt-get install apache2
备份文件位置
/backup
链接 ln -s /backup /var/www/html/file
取消链接
unlink backup
启动/重启/关闭apache
systemctl start/restart/stop apache2
然后访问 [ip]/download
就可以下载文件。
改端口可以修改
/etc/apach2/ports.conf
使用htpasswd工具
htpasswd -c users username
添加新用户去掉
-c
。
密码文件名 users
,新建目录mkdir /etc/apache2/authentication
,然后移动密码文件mv users /etc/apache2/authentication/
。
配置文件 /etc/apache2/sites-enabled/000-default.conf
加入
#Download Authentication
<Directory "/var/www/html/download">
AuthType Basic
AuthName "Download"
AuthUserFile /etc/apache2/authentication/users
Require valid-user
</Directory>
如有报错,log位置 /var/log/apache2
断点续传(带用户名密码)
curl.exe -C - -O -u user:passwd http://[ip]/download/XX.zip