在CentOS8下利用seafile软件搭建私有云
一、安装前准备工作
1. 安装EPEL源
EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.
yum -y install epel-release
2. 安装MySQL
yum -y install mariadb mariadb-server
启动mariadb,并配置root密码
systemctl start mariadb mysql_secure_installation
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
3. 安装依赖项 (Python相关)
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
二、下载、安装seafile
1. 直接从官网下载 http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_7.1.4_x86-64.tar.gz
遵从如下目录结构
mkdir /opt/seafile cd /opt/seafile #下载安装文件 wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_7.1.4_x86-64.tar.gz #如果已下载则移动至目标文件夹 # mv seafile-server_7.1.4_x86-64.tar.gz /opt/seafile tar -xzf seafile-server_7.1.4_x86-64.tar.gz mkdir installed mv seafile-server_7.1.4_x86-64.tar.gz installed
现在目录结构如图
/opt/seafile ├── installed │ └── seafile-server_7.0.0_x86-64.tar.gz └── seafile-server-7.0.0 ├── reset-admin.sh ├── runtime ├── seafile ├── seafile.sh ├── seahub ├── seahub.sh ├── setup-seafile-mysql.sh └── upgrade
这样设计目录的好处在于
-
和 seafile 相关的配置文件都可以放在
/opt/seafile/conf
目录下,便于集中管理. -
后续升级时,你只需要解压最新的安装包到
/opt/seafile
目录下.
2. 安装
cd seafile-server-7.1.4_x86-64 ./setup-seafile-mysql.sh #运行安装脚本并回答预设问题
如果你的系统中没有安装上面的某个软件,那么 Seafile初始化脚本会提醒你安装相应的软件包.
该脚本会依次询问你一些问题,从而一步步引导你配置 Seafile 的各项参数:
在这里, 你会被要求选择一种创建 Seafile 数据库的方式:
------------------------------------------------------- Please choose a way to initialize seafile databases: ------------------------------------------------------- [1] Create new ccnet/seafile/seahub databases [2] Use existing ccnet/seafile/seahub databases
-
如果选择
1
, 你需要提供根密码. 脚本程序会创建数据库和用户。(一般选1即可) -
如果选择
2
, ccnet/seafile/seahub 数据库应该已经被你(或者其他人)提前创建。
现在安装完成,目录如下
seafile ├── ccnet # configuration files │ ├── mykey.peer │ ├── PeerMgr │ └── seafile.ini ├── conf │ └── ccnet.conf │ └── seafile.conf │ └── seahub_settings.py │ └── gunicorn.conf ├── installed │ └── seafile-server_7.0.0_x86-64.tar.gz ├── seafile-data ├── seafile-server-7.0.0 # active version │ ├── reset-admin.sh │ ├── runtime │ ├── seafile │ ├── seafile.sh │ ├── seahub │ ├── seahub.sh │ ├── setup-seafile-mysql.sh │ └── upgrade ├── seafile-server-latest # symbolic link to seafile-server-7.0.0 ├── seahub-data │ └── avatars
seafile-server-latest
文件夹为指向当前 Seafile 服务器文件夹的符号链接. 将来你升级到新版本后, 升级脚本会自动更新使其始终指向最新的 Seafile 服务器文件夹.
三、启动服务器
可以根据官网说明启动
https://cloud.seafile.com/published/seafile-manual-cn/deploy/using_mysql.md
一并感谢以下文档的作者
seafile
https://manual-cn-origin.seafile.com/
https://www.howtoforge.com/tutorial/how-to-install-seafile-with-nginx-on-centos-7/
https://bbs.seafile.com/t/seafile-centos7-selinux/1452
https://bbs.seafile.com/t/topic/12057
https://blog.csdn.net/VicdorLin/article/details/80858823
https://blog.csdn.net/weixin_30507481/article/details/96771554
https://www.jianshu.com/p/61e0e66be9e1
https://www.ittel.cn/archives/2300.html
https://bbs.seafile.com/t/topic/9720
https://blog.csdn.net/weixin_44204751/article/details/106526481