Centos7安装seafile7.1.5专业版

Seafile 是一个开源的文件云存储平台,解决文件集中存储、同步、多平台访问的问,允许用户创建“群组”,在群组内共享和同步文件,方便了团队协同工作。

官方免费提供专业版,但是限制“3”用户使用,这里仅演示安装免费3用户的专业版

从 7.1.0 版本开始,Seafile 将依赖 Python 3,并且不再兼容 Python 2

Seafile-image-915x330.png

安装环境 :良心云2H4G作为演示机
操作系统:Centos7

  • 准备工作:
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 专业版需要 java 1.8 以上版本(官方推荐2G内存以上机器运行)

yum list -y java*  #搜索java安装包

fjava_tWK4tgnHGQ.png

yum install java-1.8.0 -y   #安装java1.8
  • 安装数据库和nginx(我这里为了方便小白,选择使用appnode来管理nginx和数据库)

appnode官网链接:www.appnode.com

一键安装appnode

INSTALL_AGENT=1 INSTALL_APPS=sitemgr INSTALL_PKGS='nginx-stable,mysql55' bash -c "$(curl -sS http://dl.appnode.com/install.sh)"

安装完成后显示面板登陆地址账号和密码

fjava_P8jDkHDB7C.png

登陆后进入软件管家安装 mysql服务器面板

QQ图片20200725201345.png

进入mysql服务器启动并更改mysql root密码

QQ图片20200725201507.png

进入网站管理按照提示创建运行环境(注意:网站类型选择反向代理)

chrome_GQTWTmjijv.png

创建一个网站,按照说明填写

chrome_ZR5NBRL2DR.png

点击网站设置继续设置,不然后面seafile不能上传文件
选择源文,点 编辑 将以下代码加入到合适位置,保存并部署(代码需要根据实际情况修改,我会在下面备注)

chrome_EfkOt9rA1p.png

      location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
        proxy_request_buffering off;
    }
      location /media {
        root /www/seafile-server-latest/seahub; #这是你安装seafile目录
    }

      location /seafdav {
        proxy_pass         http://127.0.0.1:8080/seafdav;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_read_timeout  1200s;
        client_max_body_size 0;
        access_log      /data/mystack/sites/129.226.12.81/log/nginx/seafdav.access.log; #这里是日志
        error_log       /data/mystack/sites/129.226.12.81/log/nginx/seafdav.error.log;  #这里是日志
    }

日志地址在下图

QQ图片20200725203545.png

切到 SSH

  • 因为seafile搜索服务需要费root账户才能运行,所以建议新建一个普通账户

新建账户并设置密码

useradd seafile   #新建账户
passwd seafile    #为新建的账户设置密码

新建文件夹并设置用户组为刚刚新建的账户

mkdir /www   #创建文件夹
chown -R seafile:seafile /www   #设置文件夹用户

切换到seafile用户并进入文件夹www

su seafile   #切换用户
cd /www   #进入www目录

fjava_qyQkYbWU3N.png

tar xf seafile-pro-server_7.1.5_x86-64_CentOS.tar.gz   #解压

进入解压目录运行安装脚本

cd seafile-pro-server-7.1.5  #进入目录
./setup-seafile-mysql.sh  #运行安装脚本并回答预设问题
  • 开始安装
[seafile@VM-0-13-centos seafile-pro-server-7.1.5]$ ./setup-seafile-mysql.sh
Checking python on this machine ...

Checking for java ...Done.

-----------------------------------------------------------------
This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at

        https://download.seafile.com/published/seafile-manual/home.md

Press ENTER to continue
-----------------------------------------------------------------


What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ]  #这里填服务器名,随便填

What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] 129.226.12.81  #服务器的 IP 地址或者域名

Which port do you want to use for the seafile fileserver?
[ default "8082" ]  #默认即可

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
你需要提供根密码. 脚本程序会创建数据库和用户。
[2] Use existing ccnet/seafile/seahub databases
ccnet/seafile/seahub 数据库应该已提前创建。

[ 1 or 2 ] 1  #选择1即可

What is the host of mysql server?
[ default "localhost" ] #默认即可

What is the port of mysql server?
[ default "3306" ]  #默认即可

What is the password of the mysql root user?
[ root password ]  输入mysql根密码

verifying password of user root ...  done

Enter the name for mysql user of seafile. It would be created if not exists.
[ default "seafile" ] seafile #默认即可

Enter the password for mysql user "seafile":
[ password for seafile ]  #设置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:            cloud
    server ip/domain:       129.226.12.81

    seafile data dir:       /www/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 /www/ccnet.
Generating seafile configuration ...

Done.
done
Generating seahub configuration ...

----------------------------------------
Now creating ccnet database tables ...

----------------------------------------
----------------------------------------
Now creating seafile database tables ...

----------------------------------------
----------------------------------------
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://download.seafile.com/published/seafile-manual/home.md

for information.


[seafile@VM-0-13-centos seafile-pro-server-7.1.5]$ 
  • 启动 Seafile:
./seafile.sh start # 启动 Seafile 服务
  • 启动 Seahub
./seahub.sh start  # 启动 Seahub 网站 (默认运行在8000端口上)如果想自定义端口在参数后面加上你的端口
# 你第一次启动 seahub 时,seahub.sh 脚本会提示你创建一个 seafile 管理员帐号。
[seafile@VM-0-13-centos seafile-pro-server-7.1.5]$ ./seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...

----------------------------------------
It's the first time you start the seafile server. Now let's create the admin account
----------------------------------------

What is the email for the admin account?
[ admin email ] #输入邮箱地址

What is the password for the admin account?
[ admin password ] #设置密码

Enter the password again:
[ admin password again ] #确认密码



----------------------------------------
Successfully created seafile admin
----------------------------------------




Seahub is started

Done.

[seafile@VM-0-13-centos seafile-pro-server-7.1.5]$ 

现在可以打开了

chrome_XAt5hl1mAS.png

  • 你还需要进行一下设置才能正常使用seafile

打开系统设置

chrome_EsWq2pTLYj.png

按照说明设置

chrome_xVt1QOJBuw.png

测试上传成功

chrome_TYRn4o4agX.png

  • 相关命令
./seafile.sh { start | stop | restart }
./seahub.sh  { start <port> | stop | restart <port> }
  • 写在最后
  1. 如果不启动,建议查看日志,日志目录:/logs
  2. 如果头像不显示,进入个人界面重新上传头像就可以了
  3. 可以使用第三方存储么,答案是可以的,目前支持S3,Ceph,swift,oss作为后端存储(目前博主使用minio作为后端存储)
  4. 如何开启Office文件在线预览,Office 预览依赖于 Libreoffice 4.1+ 和 Python-uno 库
    Libreoffice下载地址:https://zh-cn.libreoffice.org/download/libreoffice/

Libreoffice安装教程:https://zh-cn.libreoffice.org/get-help/install-howto/linux/
开启配置项
打开 conf/seafevents.conf,添加:

[OFFICE CONVERTER]
enabled = true
host = 127.0.0.1  # 本机的IP地址,默认 127.0.0.1
port = 6000  # 端口,默认6000

打开conf/seahub_settings.py,添加:

OFFICE_CONVERTOR_ROOT = 'http://127.0.0.1:6000/'  # 与seafevents.conf中的 host 和 port 保持一致

保存 seafevents.conf 与seahub_settings.py后,重启 Seafile 服务 ./seafile.sh restart

  1. 如果你还有问题可在下方留言也可以查阅官网文档

完结,本文菜鸟可放心食用,可能看我写的乱七八糟,这些都不是问题,细琢磨都能解决

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇