前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >使用Seafile搭建个人专属私有云盘

使用Seafile搭建个人专属私有云盘

作者头像
兔云小新LM
发布于 2021-01-04 02:56:17
发布于 2021-01-04 02:56:17
11.8K00
代码可运行
举报
运行总次数:0
代码可运行

文章介绍

Seafile是一款强大优秀的云同步软件,拥有跨平台文件同步、移动端文件访问、挂载盘、文件共享和权限控制、文件锁定、文件版本管理和资料库镜像、在线编辑和协同编辑、审计日志等功能。下面演示一下该软件安装步骤。

环境介绍

该安装演示过程使用的是CentOS7系统。

安装步骤

安装依赖环境

使用 yum 安装 PythonMySQL

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
yum install python python-setuptools python-imaging python-ldap python-memcached MySQL-python mariadb mariadb-server

启动 MariaDB 服务:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo systemctl start mariadb.servicea
sudo systemctl enable mariadb.service

配置 MySQL:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
/usr/in/mysql_secure_installation

配置过程输入参数如截图所示,其中 New password 和 Re-enter new password 字段都设置为 Password,其他字段一路回车使用默认值:

安装 Seafile

下载 Seafile 安装包:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
wget https://mc.qcloudimg.com/static/archive/3d8addbe52be88df4f6139ec7e35b453/seafile-server_5.1.4_x86-64.tar.gz

解压 Seafile 安装包:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
tar -zxvf seafile-server_5.1.4_x86-64.tar.gz

安装 Seafile 安装包:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo mkdir -p /opt/seafile/installed
sudo mv seafile-server_5.1.4_x86-64.tar.gz /opt/seafile/installed
sudo mv seafile-server-5.1.4/ /opt/seafile
cd /opt/seafile/seafile-server-5.1.4
sudo ./setup-seafile-mysql.sh

执行过程输入参数如截图所示,[server name] 字段输入 Seafile,[ This server's ip or domain ] 字段输入教程第一步申请的域名,[ 1 or 2 ] 字段选择 1,mysql 的 [ root password ] 字段输入 Password,其他字段一路回车使用默认值:

启动 Seafile 及修改防火墙规则
启动 Seafile
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo ./seafile.sh start
sudo ./seahub.sh start

执行过程输入参数如截图所示,其中 [ admin email ] 设置为您登录网盘的帐号,如 admin@qcloudlab.wang,[ admin password ]和[ admin password again ]设置为登录网盘的密码,如admin_Password

修改防火墙规则
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo firewall-cmd --zone=public --permanent --add-port=8082/tcp
sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp
sudo firewall-cmd --reload

CentOS在默认的情况下,防火墙是关闭的。需要开启。使用如下命令: ❞

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
systemctl start firewalls.service

效果预览

通过上面的配置,此时就可以通过服务器的IP+端口号进行访问了。效果如下:

域名配置

如果你希望通过域名访问该系统。可以使用Nginx的反向代理功能。事先你需要去解析一个域名到当前搭建的服务器上。配置格式如下:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
upstream seafile  {
    # 云盘系统启动的服务端口
    server 127.0.0.1:8000;
}

server {
    # 监听端口
    listen 80; 
    # 绑定的域名,填写您的域名
    server_name proxy.xxxx.io;

    location / {
        # 将客户端的 Host 和 IP 信息一并转发到对应节点  
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        # 转发Cookie,设置 SameSite
        proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";

        # 执行代理访问真实服务器
        proxy_pass http://seafile;
    }
}

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-12-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 卡二条的技术圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
python 查找指定目录下的指定类型文件 脚本
""" Find the largest file of a given type in an arbitrary directory tree. Avoid repeat paths, catch errors, add tracing and line count size. Also uses sets, file iterators and generator to avoid loading entire file, and attempts to work around undecodable dir/file name prints. """
用户5760343
2022/05/13
1.9K0
python 跨平台python脚本启动器
------------------------------------调用方式-------------------------------- import Launcher Launcher.launchBookExamples(['PyDemos.pyw'], trace=False) ----------------------------------Launcher.py--------------------------------
用户5760343
2022/05/13
7030
python 查找目录中最大的python文件 脚本
""" Find the largest Python source file in an entire directory tree. Search the Python source lib, use pprint to display results nicely. """ import sys, os, pprint trace = False if sys.platform.startswith('win'): dirname = r'C:\Python31\Lib'
用户5760343
2022/05/13
1.1K0
python 查找文件、删除、搜索类 脚本
""" Use: "python ...\Tools\visitor_collect.py searchstring rootdir". CollectVisitor simply collects a list of all files containing a search string, for display or later processing (e.g., replacement, auto-editing); pass in a test filename extensions list to constructor to override the default in SearchVisitor; this is roughy like find+grep for text exts; """
用户5760343
2022/05/13
6420
python 代码总行数统计 脚本
""" Count lines among all program source files in a tree named on the command line, and report totals grouped by file types (extension). A simple SLOC (source lines of code) metric: skip blank and comment lines if desired. """
用户5760343
2022/05/13
1.1K0
python模块学习
系统相关的信息模块: import sys sys.argv 是一个 list,包含所有的命令行参数. sys.stdout sys.stdin sys.stderr 分别表示标准输入输出,错误输出的文件对象. sys.stdin.readline() 从标准输入读一行 sys.stdout.write("a") 屏幕输出a sys.exit(exit_code) 退出程序 sys.modules 是一个dictionary,表示系统中所有可用的module sys.
py3study
2020/01/13
3730
Python里的OS与SYS
os.name字符串指示你正在使用的平台。比如对于Windows,它是'nt',而对于Linux/Unix用户,它是'posix'。
我被狗咬了
2019/09/23
7120
Python 【os.path()模块解析】
实例6:os.path.getatime/os.path.getmtime/os.path.getctime
IT茂茂
2020/10/26
8770
偷学Python二十六|OS.path模块的详细使用说明
大家好,从本周起早起Python将持续更新由小甜同学从初学者的角度学习Python的笔记,其特点就是全文大多由新手易理解的代码与注释及动态演示。刚入门的读者千万不要错过!
刘早起
2020/06/04
8880
python 自定义launch脚本
""" ################################################################################### launch Python programs with command lines and reusable launcher scheme classes; auto inserts "python" and/or path to Python executable at front of command line; som
用户5760343
2022/05/13
3520
python 遍历目录类 脚本
""" #################################################################################### Test: "python ...\Tools\visitor.py dir testmask [string]". Uses classes and subclasses to wrap some of the details of os.walk call usage to walk and search; testmask is an integer bitmask with 1 bit per available self-test; see also: visitor_*/.py subclasses use cases; frameworks should generally use__X pseudo private names, but all names here are exported for use in subclasses and clients; redefine reset to support multiple independent walks that require subclass updates; #################################################################################### """
用户5760343
2022/05/13
6990
Python os.path.help
Help on module posixpath in os: NAME posixpath - Common operations on Posix pathnames. FILE /usr/lib/python2.6/posixpath.py MODULE DOCS http://docs.python.org/library/posixpath DESCRIPTION Instead of importing this module directly, import o
py3study
2020/01/10
9270
python os.path模块
语法:  os.path.join(path1[,path2[,......]])
py3study
2020/01/07
9480
Python常用方法(上)
#1.生成器 range(开头,结尾,步长) range(5,-1,-1),可以逐步减少 id(xx) #打印唯一ID值 enumerate([1,2,3], 1): #配合循环使用,列表和序号,右侧指定序号初始位,需要2个变量承接 #2.随机数 random.randint(1, 10) #1-10随机 random.shuffle(xx) #对列表随机排序 random.sample(xx,3) #从列表随机抽出3个 #3.sys模块 sys.exit() #退出 sys.argv[1] #位置变量,一
陈不成i
2021/06/21
3340
python os.path模块
os.path模块主要用于文件的属性获取,在编程中经常用到,以下是该模块的几种常用方法。更多的方法可以去查看官方文档:http://docs.python.org/library/os.path.html
周小董
2019/03/25
5010
python 目录复制类 脚本
""" Use: "python ...\Tools\visitor_cpall.py fromDir toDir trace?" Like System\Filetools\cpall.py,
用户5760343
2022/05/13
5510
nginx切割日志脚本(python)
因为以前没有做nginx日志分割,有时候想看日志的时候总是发现有十几G的甚至上百G的日志文件,于是就想使用python写个nginx日志分割(当然你也可以使用shell来完成都是很简单)
py3study
2020/01/07
8420
[快学Python3]目录与文件操作
概述 本文就os和path模块中常用的方法进行了说明和列举,更多的方法和技巧请参加官方文档 os模块常用方法 我们先看看os模块所提供的目录操作方法,直接上代码实例: # -*- coding:utf-8 -*- __author__ = '苦叶子' # 导入os模块 import os if __name__ == "__main__": # 返回完整的路径目录 print("获取当前工作目录") print(os.getcwd()) # 返
苦叶子
2018/04/09
1.8K0
python guimixin 消息调用 工具dialog封装
""" ############################################################################### a "mixin" class for other frames: common methods for canned dialogs, spawning programs, simple text viewers, etc; this class must be mixed with a Frame (or a subclass derived from Frame) for its quit method ############################################################################### """
用户5760343
2022/05/13
3290
Python中os与sys两模块的区别 原
os: This module provides a portable way of using operating system dependent functionality.
晓歌
2018/08/15
5360
相关推荐
python 查找指定目录下的指定类型文件 脚本
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档