使用 seafile搭建私有云盘
Posted danteit
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用 seafile搭建私有云盘相关的知识,希望对你有一定的参考价值。
一、系统环境
系统:CentOS7-1708
IP地址:192.168.159.33
二、安装seafile
[[email protected] ~]# yum -y install epel-release
[[email protected] ~]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
[[email protected] ~]# yum -y install python-imaging mysql-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel
[[email protected] ~]# yum -y install python-pip
[[email protected] ~]# pip install --upgrade pip
[[email protected] ~]# pip install pillow moviepy
[[email protected] ~]# yum install -y mariadb-server ##安装数据库
[[email protected] ~]# systemctl enable mariadb ##设置数据库开机启动
[[email protected] ~]# systemctl start mariadb ##启动数据库
[[email protected] ~]# mysql_secure_installation ##为数据库设置密码
[[email protected] ~]# wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_6.2.3_i386.tar.gz ##下载seafile软件包
[[email protected] ~]# tar -zxf seafile-server_6.2.3_x86-64.tar.gz ##解压软件包
[[email protected] ~]# mkdir -p seafile/installed/ ##创建安装包存放位置
[[email protected] ~]# mv seafile-server_6.2.3_x86-64.tar.gz seafile/installed/
[[email protected] ~]# mv seafile-server-6.2.3/ seafile/
[[email protected] ~]# cd seafile/
[[email protected] seafile]# cd seafile-server-6.2.3/
[[email protected] seafile-server-6.2.3]# ./setup-seafile-mysql.sh ##会要填很多信息,按要求填就可以了
三、设置防火墙、selinux
设置SELinux
[[email protected] ~]#vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
使selinux立即生效
[[email protected] ~]#setenforce 0
添加防火墙允许通行端口
[[email protected] ~]#firewall-cmd --zone=public --add-port=8000/tcp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=8082/tcp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=3306/tcp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=10001/tcp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=12001/tcp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=8000/udp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=8082/udp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=3306/udp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=10001/udp --permanent
[[email protected] ~]#firewall-cmd --zone=public --add-port=12001/udp --permanent
[[email protected] ~]#firewall-cmd --reload ##加载防火墙规则使其立即生效
[[email protected] ~]#firewall-cmd --zone=public --list-ports ##查看放行端口
四、启动seafile
启动seafile
[[email protected] seafile-server-6.2.3]# ./seafile.sh start # 启动 Seafile 服务
[[email protected] seafile-server-6.2.3]# ./seahub.sh start # 启动 Seahub 网站 (默认运行在8000端口上),可指定端口
设置开机启动(ExecStart ExecStop替换为相应安装位置)
[[email protected] ~]#vi /usr/lib/systemd/system/seafile.service
[Unit]
Description=Seafile Service
After=network.target
After=mariadb.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/seafile/seafile/seafile.sh start
ExecStart=/seafile/seafile/seahub.sh start
#ExecStop=/seafile/seafile/seafile.sh stop
#ExecStop=/seafile/seafile/seahub.sh stop
[Install]
WantedBy=multi-user.target
[[email protected] ~]#systemctl enable seafile
[[email protected] ~]#systemctl start seafile
[[email protected] ~]#systemctl status seafile
以上是关于使用 seafile搭建私有云盘的主要内容,如果未能解决你的问题,请参考以下文章
Linux搭建开源企业云盘Seafile,私有文件同步云盘及基本使用