惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

Rat's Blog - vps

SpartanHost:512MB内存/10GB硬盘/1T流量/DDoS防御/KVM/西雅图/最低月付$2 - Rat's Blog 一个去中心化的图片分享平台:ipfs.pics搭建教程 - Rat's Blog Linux VPS一键更换软件源脚本 - Rat's Blog 使用Aira2下载文件后自动上传到Google Drive网盘 - Rat's Blog Linux VPS一键安装桌面环境和RDP远程桌面连接 - Rat's Blog Kvmla:1G内存/40G硬盘/600G流量/日本&香港&新加坡KVM/月付¥80 - Rat's Blog 新型功能强大的VPS虚拟主机控制面板:BrainyCP安装教程 - Rat's Blog VPS服务器如何优化/加快网站的访问速度 - Rat's Blog loader工具转换成Debian 9系统 - Rat's Blog
Flask+WebUploader实现快速将本地文件上传到VPS服务器 - Rat's Blog
博主: Rat's · 2018-10-14 · via Rat's Blog - vps

说明:之前博主就写过一篇将本地文件上传至VPS服务器的教程→点击查看,虽然该教程使用的jQuery-File-Upload很强大,但配置起来还是有点麻烦,现在再分享一个上传工具,使用Flask+WebUploader实现上传功能,使用起来很简单,但是不如jQuery-File-Upload稳定,不过各有所需,用来上传小文件是足矣的。

截图

请输入图片描述

安装

Github地址:https://github.com/abbeyokgo/flask_multi_uploader

1、安装依赖

#CentOS 6.x 32位
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install -y python-pip git

#CentOS 6.x 64位
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y python-pip git

#CentOS 7.x
yum install -y epel-release
yum install -y python-pip git
#如果CentOS 7安装出现No package python-pip available,可以用以下命令进行安装
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

#Debian/Ubuntu系统
apt-get -y update
apt-get -y install python-pip git

2、运行程序

git clone https://github.com/abbeyokgo/flask_multi_uploader.git
cd flask_multi_uploader
#安装依赖
pip install -r requirements.txt
#启动程序,8888端口可自行修改
gunicorn -k eventlet -b 0:8888 server:app

如果启动的时候提示-bash: gunicorn: command not found错误,需要先运行命令:

pip install gunicorn

然后再使用命令启动程序,接下来就可以访问IP:8888上传文件了,上传文件保存在upload文件夹。如果Web界面打不开,可能需要开启防火墙端口。

#CentOS 6
iptables -I INPUT -p tcp --dport 8888 -j ACCEPT
service iptables save
service iptables restart

#CentOS 7
firewall-cmd --zone=public --add-port=8888/tcp --permanent
firewall-cmd --reload

开启端口后你会发现,启动命令运行出错了,这时候使用Ctrl+C断开命令,再重新使用命令启动即可。

如果你需要常驻后台,就得使用screen命令了,使用查看→传送门


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/766/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。