目录
部署
下载安装包
安装pip
安装其他依赖
安装
启动
重新部署
官网:https://www.seafile.com/home/
文档:https://manual-cn.seafile.com/
源码:https://github.com/haiwen/seafile-docs-cn
部署
下载安装包
https://www.seafile.com/download/
linux服务器端6.3.4 64bit
安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
安装其他依赖
yum -y install epel-release rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro yum -y install python-imaging MySQL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel pip install pillow moviepy
安装
拷贝包seafile-server_6.3.4_x86-64.tar.gz到目录后
tar -xzf seafile-server_*
cd seafile-server-*
./setup-seafile-mysql.sh #运行安装脚本并回答预设问题
该脚本会依次询问你一些问题,从而一步步引导你配置 Seafile 的各项参数:
参数 | 作用 | 说明 |
seafile server name | seafile 服务器的名字,目前该配置已经不再使用 | 3 ~ 15 个字符,可以用英文字母,数字,下划线 |
seafile server ip or domain | seafile 服务器的 IP 地址或者域名 | 客户端将通过这个 IP 或者地址来访问你的 Seafile 服务 |
seafile data dir | seafile 数据存放的目录,用上面的例子,默认将是 /data/haiwen/seafile-data | seafile 数据将随着使用而逐渐增加,请把它放在一个有足够大空闲空间的分区上 |
seafile fileserver port | seafile fileserver 使用的 TCP 端口 | 该端口用于文件同步,请使用默认的 8082,不能更改。 |
在这里, 你会被要求选择一种创建 Seafile 数据库的方式:
------------------------------------------------------- Please choose a way to initialize seafile databases: ------------------------------------------------------- [1] Create new ccnet/seafile/seahub databases [2] Use existing ccnet/seafile/seahub databases
- 如果选择1, 你需要提供根密码. 脚本程序会创建数据库和用户。
- 如果选择2, ccnet/seafile/seahub 数据库应该已经被你(或者其他人)提前创建。
选择1,依次配置
What is the host of mysql server?
[ default "localhost" ] 10.1.69.91
From which hosts could the mysql account be used?
[ default "%" ]
What is the port of mysql server?
[ default "3306" ]
What is the password of the mysql root user?
[ root password ]
verifying password of user root ... done
Enter the name for mysql user of seafile. It would be created if not exists.
[ default "seafile" ]
Enter the password for mysql user "seafile":
[ password for seafile ]
Enter the database name for ccnet-server:
[ default "ccnet-db" ]
Enter the database name for seafile-server:
[ default "seafile-db" ]
Enter the database name for seahub:
[ default "seahub-db" ]
配置确认
---------------------------------
This is your configuration
---------------------------------
server name: xxxx
server ip/domain: 192.168.91.150
seafile data dir: /root/seafile-data
fileserver port: 8082
database: create new
ccnet database: ccnet-db
seafile database: seafile-db
seahub database: seahub-db
database user: seafile
---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------
此时点回车继续
Generating ccnet configuration ...
done
Successly create configuration dir /root/ccnet.
Generating seafile configuration ...
Done.
done
Generating seahub configuration ...
----------------------------------------
Now creating seahub database tables ...
----------------------------------------
creating seafile-server-latest symbolic link ... done
-----------------------------------------------------------------
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
When problems occur, Refer to
https://github.com/haiwen/seafile/wiki
for information.
此时安装已成功
启动
在 seafile-server-1.8.2 目录下,运行如下命令
- 启动 Seafile:
./seafile.sh start # 启动 Seafile 服务
- 启动 Seahub
./seahub.sh start <port> # 启动 Seahub 网站 (默认运行在8000端口上)
小贴士: 你第一次启动 seahub 时,seahub.sh 脚本会提示你创建一个 seafile 管理员帐号。
服务启动后, 打开浏览器并输入以下地址
http://192.168.1.111:8000/
你会被重定向到登陆页面. 输入管理员用户名和密码即可。
恭喜! 现在你已经成功的安装了 Seafile 服务器.
重新部署
重新部署需要删除外部创建的目录
rm -rf ccnet/ conf/ logs/ pids/ seafile-data/ seafile-server-latest seahub-data/
删掉mysql新增seafile用户及如下三个数据库
ccnet database: ccnet-db
seafile database: seafile-db
seahub database: seahub-db