linux下安装seafile云盘存储Seafile安装教程
安装前准备:
1. 系统: CentOS-7
2. 环境:python 2.7、python-setuptools
3. 数据库:Mysql 5.6
4. 应⽤服务包:seafile-pro-server_7.0.14_x86-64.tar
安装步骤:
⼀、创建⽬录:
[root@CentOS-7 ~]# mkdir JD-Seafile
在root根⽬录下创建JD-Seafile⽬录
[root@CentOS-7 ~]# cd JD-Seafile
进⼊JD-Seafile⽬录
[root@CentOS-7 JD-Seafile]# mkdir Seafile-Server
创建Seafile-Server⽬录
[root@CentOS-7 JD-Seafile]# mkdir installed
创建 installed ⽬录
[root@CentOS-7 JD-Seafile]# 将 seafile-pro-server_7.0.14_x86-64.tar 安装包上传⾄此⽬录下
[root@CentOS-7 JD-Seafile]# mv seafile-pro-server_7.0.14_ installed/
将安装包移动⾄ installed ⽬录
[root@CentOS-7 JD-Seafile]# cd installed/
进⼊ installed ⽬录
[root@CentOS-7 installed]# tar -xzf seafile-pro-server_7.0.14_
将安装包解压⾄ installed 根⽬录下
[root@CentOS-7 installed]# cd ..
退出返回⾄ JD-Seafile ⽬录下
[root@CentOS-7 JD-Seafile]#将 seafile-pro-server_7.0.14_x86-64.tar 安装包复制⾄此⽬录下
[root@CentOS-7 JD-Seafile]# tar -xzf seafile-pro-server_7.0.14_
将安装包解压⾄ JD-Seafile 根⽬录下
[root@CentOS-7 JD-Seafile]# mv seafile-pro-server-7.0.14/ Seafile-Server/
将解压出来的⽂件⽬录移动⾄ Seafile-Server ⽬录下
[root@CentOS-7 ~]# yum -y install tree
安装 tree 命令包
[root@CentOS-7 ~]# tree JD-Seafile -L 2
执⾏tree命令查看 JD-Seafile ⽬录的架构
⽬录显⽰如下:
JD-Seafile
├── installed
│├── seafile-pro-server-7.0.14
│└── seafile-pro-server_7.0.14_
├── seafile-pro-server_7.0.14_
└── Seafile-Server
└── seafile-pro-server-7.0.14
这样设计⽬录的好处在于:
1.与seafile 相关的配置⽂件都可以放在 JD-Seafile⽬录下,便于集中管理.
2.后续升级时,你只需要解压最新的安装包到 JD-Seafile ⽬录下.
⼆、安装mysql:
[root@CentOS-7 ~]# wget arch.rpm
下载 mysql 的repo源
[root@CentOS-7 ~]# rpm -arch.rpm
安装 arch.rpm 包
root@CentOS-7 ~]# yum install mysql-server
安装mysql
[root@CentOS-7 ~]# mysql_install_db --datadir=/var/lib/mysql
初始化Mysql数据库
数据库管理系统就是数据库系统
[root@CentOS-7 ~]# chown mysql:mysql /var/lib/mysql -R
修改Mysql数据库⽬录的所属⽤户及其所属组,也就是使⽤ mysql这个账户启动数据库,默认是root⽤户
[root@CentOS-7 ~]# service mysqld restart
重新启动mysql
2022新版系统源码[root@CentOS-7 ~]# mysql -u root
使⽤root账户进⼊数据库
mysql> use mysql;
修改使⽤mysql账户登录数据库
mysql > update user set password=password('123') where user='root';
修改mysql数据的root密码
mysql > exit;
[root@CentOS-7 ~]# mysql -u root -p
当数据库root设置了密码,需执⾏此命令登录数据库
三、安装seafile
[root@CentOS-7 ~]# cd JD-Seafile/Seafile-Server/seafile-pro-server-7.0.14/进⼊安装包所解压的⽬录
centos和ubuntu[root@CentOS-7 seafile-pro-server-7.0.14]# ./setup-seafile-mysql.sh
执⾏安装后,如果系统中缺少组件,seafile会提⽰:
Checking python on this machine ...
Checking python module: python-mysqldb ...
python-mysqldb  is not installed, Please install it first.
On Debian/Ubuntu:
sudo apt-get install python-mysqldb
On CentOS/RHEL:
sudo yum install MySQL-python
Error occured during setup.
Please fix possible problems and run the script again.
[root@CentOS-7 ~]# sudo yum install MySQL-python
按照提⽰安装缺少的组件
[root@CentOS-7 seafile-pro-server-7.0.14]# ./setup-seafile-mysql.sh
再次执⾏安装,发现缺少如下组件:
Checking python on this machine ...
Checking python module: python-mysqldb ... Done.
Checking for java ...
Java is not found. install it first.
On Debian/Ubuntu:    apt-get install default-jre
On CentOS/RHEL:      yum install jre
Error occured during setup.
Please fix possible problems and run the script again.
[root@CentOS-7 ~]# yum install jre
安装缺少的jre组件
[root@CentOS-7 seafile-pro-server-7.0.14]# ./setup-seafile-mysql.sh
linux date命令再次执⾏,然后按照提⽰完成安装流程
安装成功后会有如下显⽰:
-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-
----------------------------------------------------------------
run seafile server:    ./seafile.sh { start | stop | restart }
run seahub  server:    ./seahub.sh  { start <port> | stop | restart <port> }
-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports: -----------------------------------------------------------------
port of seafile fileserver:  8082
port of seahub:              8000
四、调试Seafile服务
[root@CentOS-7 ~]# cd JD-Seafile/Seafile-Server/conf/
进⼊安装⽬录中的conf⽬录
[root@CentOS-7 ~conf]# fhtml5视频
编辑此配置⽂件
#bind = “127.0.0.1:8000” 将127.0.0.1 改为 0.0.0.0
[root@CentOS-7 seafile-pro-server-7.0.14]#  ./seafile.sh start
进⼊seafile安装⽬录,启动seafile服务
redis设置过期时间命令
[root@CentOS-7 seafile-pro-server-7.0.14]# ./seahub.sh start
启动 Seahub,第⼀次启动 Seahub时,会提⽰你创建⼀个seafile管理员账户[root@CentOS-7 ~]# systemctl stop firewalld
关闭系统防⽕墙,否则打不开⽹站

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。