Seafile私有云盘搭建详解

目前,开源私有云盘的可选方案有:Seafile、Nextcloud、ownCloud、可道云等等,前两个为目前最火热的方案。考虑到国产化因素,本文最终选择了由清华大学的学长开发的Seafile,目前已在北大、清华等高校、中国平安等金融机构使用。

1. 服务器系统要求

  • Seafile 6.0.7版本:Windows服务器端
  • Seafile 7.0.x版本(基于Python2):CentOS 7、Ubuntu 16.04
  • Seafile 7.1.x版本(基于Python3):CentOS 8、Ubuntu 18.04、Debian 10

总结:考虑到2020年1月1日起,官方宣布结束对Python2.7的支持,建议选择最新的7.1.x版本,使用Centos 8等服务器系统。

确定服务器系统版本后,如果使用的是VMware虚拟机,需要配置网路,设定一个静态IP用作远程连接和日后访问,并保证内外网络相通,并开放8000、8082端口;如果使用的阿里云或腾讯云服务器,无需配置网络环境(本身就能与互联网互通),但需要在安全组中开放8000、8082端口。

2. 安装系统环境

  • 数据库:MySQL、SQLite
  • Web服务器:Nginx、Apache
  • 语言环境:Python2、Python3
  • 其他:python3-setuptools、python3-pip、python3-ldap(必选)

总结:本文最终选用CentOS 8+MySQL+Nginx+Python3+Seafile 7.1.x

由于MySQL、Nginx的安装教程已有很多,本文不再赘述(需要注意的是,安装完MySQL后进行初始化,并记住密码)。Python3及相关依赖环境的安装直接执行以下代码即可:

yum install python3 python3-setuptools python3-pip python3-ldap -y
pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools \django-pylibmc django-simple-captcha

3. 安装Seafile服务器

  • 第一步:下载Seafile服务器安装包
https://www.seafile.com/download/
  • 第二步:在服务器上新建Seafile目录
mkdir /opt/Seafile
  • 第三步:将下载好的Seafile服务器安装包通过FTP工具上传至/opt/seafile目录
  • 第四步:在终端中,解压并安装Seafile
cd /opt/seafile
tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed #将压缩包移至installed目录中,之后就用不着它了
cd /opt/seafile/seafile-server-* #进入解压包的目录
./setup-seafile-mysql.sh #运行安装脚本
  • 第五步:依据提示,输入相关信息。需要注意的是,数据库选项选择“新建数据库”,接着输入上文提到的MySQL密码。官方手册没有指出要自己配置数据库和Web服务器,导致许多新入门的同学在输入数据库密码这一步卡死。
  • 第六步:测试一下seafile服务器能否启动,显示success即证明安装成功。
cd /opt/seafile/seafile-server-* #进入Seafile服务器目录
./seafile.sh start # 启动 Seafile 服务
./seahub.sh start  # 启动 Seahub 网站 (默认运行在127.0.0.1:8000端口上)
  • 第七步:恭喜你已经完成Seafile服务器的安装,进度条已到达80%,再简单配置一下Nginx就大功告成啦。

4. 配置环境

cd /etc/nginx #进入你安装的Nginx目录
vim nginx.conf #修改Nginx配置文件,具体如下:(需要将server_name改为自己的IP地址,其余部分可以不用改)------------------------------------------------------------------------------------------------------------
user  root;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;client_max_body_size 0; #上传文件大小不设限,原配置是限制了1M的上传大小#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80;server_name  1.1.1.1;proxy_set_header X-Forwarded-For $remote_addr;#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   html;index  index.html index.htm;proxy_pass         http://127.0.0.1:8000;proxy_set_header   Host $host;proxy_set_header   X-Real-IP $remote_addr;proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header   X-Forwarded-Host $server_name;proxy_read_timeout  1200s;# used for view/edit office file via Office Online Serverclient_max_body_size 0;access_log      /var/log/nginx/seahub.access.log;error_log       /var/log/nginx/seahub.error.log;}location /seafhttp {rewrite ^/seafhttp(.*)$ $1 break;proxy_pass http://127.0.0.1:8082;client_max_body_size 0;proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;proxy_connect_timeout  36000s;proxy_read_timeout  36000s;proxy_send_timeout  36000s;send_timeout  36000s;}location /media {root /opt/seafile/seafile-server-latest/seahub;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  1.1.1.1;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}
  • 接着,重启Nginx
nginx -s reload

5. 启动

./seafile.sh restart # 停止当前的 Seafile 进程,然后重启 Seafile
./seahub.sh restart  # 停止当前的 Seahub 进程,并在 8000 端口重新启动 Seahub

在浏览器中,输入你的IP地址,即可登录

大功告成~~~

6. 总结与展望

在功能方面,基础版的Seafile已经搭建完成了,后续可以安装OnlyOffice等工具实现在线预览PDF、Doc等功能,可参考https://www.jianshu.com/p/26c955e8c26a

在外观方面,可以自定义颜色、图标等

Seafile私有云盘搭建详解相关推荐

  1. 使用ipv6内网穿透,实现私有云盘搭建,实现远程控制等功能

    文章目录 问题 获得计算机的ipv6地址 ipv6变化问题 解决-桌面远程控制 ipv6控制路由器 解决-私有云盘搭建 创建服务端B的环境配置 创建服务端可以访问的用户账户 配置服务器对ipv6地址访 ...

  2. 阿里云AMD服务器计算型实例规格族c6a实例CPU网络收发包云盘IOPS详解

    查看全文 http://www.taodudu.cc/news/show-4527620.html 相关文章: 如何区别阿里云服务器ECS计算型c6和c6e? 阿里云安全增强计算型c6t云服务器参数详 ...

  3. 云安全:Cloudstack云平台搭建详解及经验总结

    前言: 正在学习云安全,不搭建云平台,总感觉学的有些虚,没落到实处.在网上查资料了解到,Cloudstack产品比较成熟,已经有成熟的企业应用.而且相对OpenStack配置没那么复杂,所以就先从简单 ...

  4. 云端车牌识别之私有云车牌识别详解

    关键词 云端车牌识别sdk.私有云车牌识别.ocr车牌识别.车牌识别sdk.私有化部署车牌识别技术.私有化车牌识别.私有云部署车牌识别. 现在很多行业都已经用上了我们ocr车牌识别,如:电子警察.汽车 ...

  5. seafile私有网盘搭建

    1.1 环境要求 centos7.3 python2.7 python-setuptools mysql已经安装并且服务正常运行中(如果没有安装,请先安装,因为在安装seafile过程中,要用到mys ...

  6. Windows平台下私有云盘搭建

    一.工具下载 官网:Releases · filebrowser/filebrowser · GitHub 本人使用的安装包:https://download.csdn.net/download/we ...

  7. php开源 云盘,开源云盘利器:Nextcloud 21私有云盘搭建

    这款产品就不多介绍了,进来看的小伙伴多少有点了解,就直接进入正题,如果有不了解的小伙伴可以自行查阅,背景类似mysql和mariadb. 正文 环境 系统版本:CentOS 7 数据库:Mariadb ...

  8. 阿里云本地SSD型实例i2gne云服务器配置性能详解

    阿里云本地SSD型实例i2gne云服务器配置性能CPU.内存.适用场景.本地SSD型i2gne实例规格族和优惠报价信息,InstanceTypes分享本地SSD型i2gne实例详解: 本地SSD型i2 ...

  9. 如何搭建个人网盘 -Nextcloud个人云盘搭建完整过程-Centos系列

    Nextcloud私有云盘搭建教程 环境: 操作系统:centos_7.6 x86-64mariadb:5.5.56-Mariadbphp:php 7.0.31nextcloud:nextcloud- ...

  10. (Linux)私人云盘seafile搭建详解

    前言 随着时代的发展,我们的生活正越来越贴近互联网.我们会把自己创造出的数据上传到网络上,也会将网络上我们感兴趣的数据下载到我们的存储设备上.新媒体的发展,更是使得每分钟都会有大量依托于网络的作品被创 ...

最新文章

  1. 展望未来:使用 PostCSS 和 cssnext 书写 CSS
  2. MySQL数据库初识(基础语句)
  3. Idea 七步建立Spring Mvc 的web项目,极其简单
  4. 【Android 逆向】整体加固脱壳 ( DexClassLoader 加载 dex 流程分析 | DexFile loadDexFile 函数 | 构造函数 | openDexFile 函数 )
  5. Little Sub and Apples
  6. 高速公路 (Highway,CERC 2006,LA 3720)
  7. 【Java】Volitile的作用、JVM规范如何要求内存屏障、硬件层级内存屏障如何帮助java实现高并发 - 第二天笔记
  8. java java编码_Java编码约定被认为是有害的
  9. 古天乐、胡歌登上核心期刊,他们的名字被用来命名一个新物种!
  10. 在Eclipse 中打开当前文件夹
  11. 【kafka】kafka 建立很多很多消费组 会怎么样
  12. 95后频频离职,是员工本人问题?
  13. Hbase 深度使用分析
  14. gtasa手机版android7.1,圣安地列斯psp移植版
  15. linux的ls -l显示的total 4是什么意思?我使用ls -a -l显示的total12,同一个文件夹显示了不同的信息?
  16. 永久关闭WPS热点,防止自启动
  17. matlab的kron函数(kronecker乘积)
  18. OpenWrt/Wifidog本地化解决方案
  19. 赛码网 Manager
  20. 华为 日志服务器 配置文件,华为设置日志服务器配置

热门文章

  1. 【程序思考】人穷志短,千古名言
  2. Android项目实践(二)——日记本APP(V2)
  3. 剑指Offer 09.用两个栈实现队列(LIFO与FIFO)
  4. Ubuntu16.04 + Titan XP + cuda8.0 + cudnn5.1 + opencv3.3.0 + caffe
  5. 来看看一位阿里P9的年薪和资产
  6. 云端卫士实战录 React + Redux 前端项目实践
  7. 【Appium】使用W3C actions方法长按元素
  8. 行为式验证码小侃,滑块验证码详解
  9. tensorflow构建神经网络回归分析可视化
  10. win10系统开始菜单没反应的解决方法丨解决win10点击开始按钮无反应丨点击开始按钮没有反应怎么办