源码安装seafile

2024-05-31 17:58
文章标签 源码 安装 seafile

本文主要是介绍源码安装seafile,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


1.github上有关于vagrant+virturalbox搭建开发环境的教程,但是没有看懂。

附上地址:https://github.com/haiwen

2.基本上和官网教程类似。 但是有些其他问题会坑死人。 先附上解决的坑。 



seafile编译开发文档。

https://manual.seafile.com/develop/index.html


填坑环节:

1.源码编译过程中会出现无数的警告。和其他看着不顺眼的像错误但是不是错误的东西。

答: 这些东西都不用管,只要没有提示ERROR。  都是没有问题的。 

2.在运行seafile-admin集体部署的时候没有像现成的安装包那样提示用户输入邮件地址(管理员账号)。

答:源码编译是不提示的。 你可以运行seafile-admin create-admin命令来创建管理员账户。或者seafile-admin reset-admin命令来设置管理员账户。

3.网页打开出现internatal ERROR的错误。

答:解决办法和4问题是一样的。 

4.网页出现Page unavailable错误。

答:网上查到的攻略说是python少库。

pip install gunicorn          

pip install rcssmin           

pip install django-picklefield    

后解决此问题。   然而作者安装了,还是出现这个问题,最后没办法全部删除,使用

  • libsearpc-3.0-latest.zip
  • ccnet-server-6.2.5-server.tar.gz
  • seafile-server-6.2.5-server.tar.gz
  • seahub-6.2.5-server.tar.gz

对应的这四个版本全部重新安装后,奇迹的般的好了, 所以,作者总结:可能和版本的对应有关系。

附:web端开始是没有问题的。   然后连接个手机端自此web端崩溃了, 再也没好过,但是安卓端和电脑PC端上传下载同步文件都是正常的。 有谁解决了这个问题给作者也说下,感谢感谢。

这个问题作者自行解决了。这是因为头像使用了 jpeg 格式的图片。需要重新安装下 python pillow 库,以便支持从 jpeg 格式的图片生成缩略图。

5.源码编译安装的seahub页面是英文的,下拉菜单无法更改语言。

答:执行一下seahub里面的i18n.sh脚本,问题就解决了。

6.


Server

Preparation

The following list is all the libraries you need to install on your machine. You should install all of them before you build seafile.

+

Package names are according to Ubuntu 12.04. For other Linux distros, please find their corresponding names yourself.

+

  • libevent-dev (2.0 or later )
  • libcurl4-openssl-dev (1.0.0 or later)
  • libglib2.0-dev (2.28 or later)
  • uuid-dev
  • intltool (0.40 or later)
  • libsqlite3-dev (3.8 or later)
  • libmysqlclient-dev (5.5 or later)
  • libarchive-dev
  • libtool
  • libjansson-dev
  • valac
  • libfuse-dev

Also, python 2.7 is required since seafile server 5.1.0.

+

The following libraries need to be compiled from source.

+

Notes about MySQL client library

You can also use MariaDB's LGPL Connector/C library. Download the latest stable version of the library on https://downloads.mariadb.org/connector-c/ then compile and install the library.

+

cmake .
make
sudo make install

By default the library will be installed under /usr/local/lib/mariadb. Add this path to your LD_LIBRARY_PATH environment variable so the loader can find this library.

+

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/mariadb

libevhtp

  • Download libevhtp.
  • Build libevhtp by:
cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
make
sudo make install

Seahub dependencies

Seahub is the web front end of Seafile. It's written in the django framework. Seahub requires Python 2.6(or 2.7) installed on your server, and it needs the following python libraries:

+

  • Django 1.8
  • pytz
  • django-statici18n
  • djangorestframework
  • django_compressor
  • django-post_office
  • django-constance (install it by pip install https://github.com/haiwen/django-constance/archive/bde7f7c.zip)
  • gunicorn
  • flup
  • chardet
  • python-dateutil
  • six
  • openpyxl

Before continue, make sure you have all the above libraries available in your system.

+

Prepare the directory layout

In the following sections, you'll be guided to build and setup the seafile server step by step. Seafile server is consisted of several components. In order for them to function correctly, you must:

+

  • Follow our instructions step by step
  • Make sure your directory layout is exactly the same with the guide in each step.

First create the top level directory. In the following sections, we'll use "/data/haiwen" as the top level directory.

+

mkdir /data/haiwen/
cd /data/haiwen/
mkdir seafile-server
cd seafile-server

The currently layout is:

+

haiwen/
└── seafile-server

Get the source

First you should get the latest source of libsearpc/ccnet-server/seafile-server/seahub

+

Download the source tarball of the latest tag from

+

  • https://github.com/haiwen/libsearpc/tags
  • https://github.com/haiwen/ccnet-server/tags
  • https://github.com/haiwen/seafile-server/tags
  • https://github.com/haiwen/seahub/tags

For example, if the latest released seafile server is 6.0.1, then just use the v6.0.1-server tags of the projects (except for libsearpc, which uses the v3.0-latest tag). You should get four tarballs:

+

  • libsearpc-3.0-latest.tar.gz
  • ccnet-server-6.0.1-server.tar.gz
  • seafile-server-6.0.1-server.tar.gz
  • seahub-6.0.1-server.tar.gz

Create a folder haiwen/src, and uncompress libsearpc/ccnet/seafile source to it.

+

cd haiwen/seafile-server
mkdir src
cd src
tar xf /path/to/libsearpc-3.0-latest.tar.gz
tar xf /path/to/ccnet-server-6.0.1-server.tar.gz
tar xf /path/to/seafile-server-6.0.1-server.tar.gz

And uncompress seahub tarball to haiwen/seafile-server:

+

cd haiwen/seafile-server
tar xf /path/to/seahub-6.0.1-server.tar.gz
mv seahub-6.0.1-server seahub

So far, The current directory layout is:

+

haiwen/
└── seafile-server└── seahub└── src├── libsearpc-6.0.1-server├── ccnet-server-6.0.1-server├── seafile-server-6.0.1-server├── ... (other files)

Building

To build seafile server, you need first build libsearpc and ccnet-server.

+

libsearpc
cd libsearpc-${version}
./autogen.sh
./configure
make
make install
ccnet-server
cd ccnet-server-${version}
./autogen.sh
./configure # `export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig` if libsearpc is not found
make
make install

By default, configure tries to find MySQL and Postgresql client libraries in the system. If you do not want to support MySQL or Postgresql, use the following configure options:

+

./configure --without-mysql --without-postgresql

If you want to use MariaDB Connector/C library, use the following configure option:

+

./configure --with-mysql=/usr/local/bin/mariadb_config
seafile-server
cd seafile-${version}
./autogen.sh
./configure
make
make install

You can use the same options as ccnet-server to configure MySQL and Postgresql client libraries.

+

Note: You need to run sudo ldconfig to refresh the system libraries cache after you compiles all the components.

+

Deploy Seafile Server

Components of the Seafile Server

The seafile server consists of the following components:

+

Process NameFunctionality
ccnet-serverunderlying networking
seaf-serverdata management
Seahubwebsite front-end of seafile server
fileserverhandles raw file upload/download for Seahub

  • ccnet stores its configuration and metadata is a directory named ccnet.
  • seaf-server store its configuration and data in a directory, normally named seafile-data.
  • seahub is written in Django. If you have any experience with Django, you should know the syncdbcommand must be run to create all the database tables.
  • An admin account has to be created, so that you, the admin, can login with this account to manage the server.

These are the essential steps to create the configuration:

+

  • ensure seafile is already installed and all the python libraries seahub needs are installed.
  • create the ccnet configuration with the ccnet-init program
  • create the seafile configuration with seaf-server-init program
  • run Django syncdb command for seahub
  • create an admin account for the seafile server

To create the configurations, you can either:

+

  • use the seafile-admin script(see below)
  • [[create server configuration by hand]]

Create Configurations with the seafile-admin script

seafile-admin should have been installed to system path after you have built and installed Seafile from source.

+

usage: seafile-admin [-h] {setup,start,stop,reset-admin} ...optional arguments:-h, --help            show this help message and exitsubcommands:{setup,start,stop,reset-admin}setup               setup the seafile serverstart               start the seafile serverstop                stop the seafile serverreset-admin         reset seafile admin account

Go to the top level directory(in this guide it's /data/haiwen/), and run seafile-admin setup to create all the configuration:

+

cd /data/haiwen
export PYTHONPATH=/data/haiwen/seafile-server/seahub/thirdpart
seafile-admin setup

The script would ask you a series of questions, and create all the configuration for you.

+

NameUsageDefaultRequirement
server nameThe name of the server that would be shown on the client 3 ~ 15 letters or digits
ip or domainThe ip address or domain name of the server Make sure to use the right ip or domain, or the client would have trouble connecting it
ccnet portthe tcp port used by ccnet10001 
seafile porttcp port used by seafile12001 
seafile fileserver porttcp port used by seafile fileserver8082 
admin emailEmail address of the admin account  
admin passwordpassword of the admin account  

This is a screenshot of the seafile-admin setup command: 

+

And a screenshot after setup is finished successfully: 

+

At this time, the directory layout would be like this:

+

haiwen/
└── ccnet # ccnet config directory└── ccnet.conf # ccnet config file
└── seafile-data # seafile configuration and data└── seafile.conf # seafile config file
└── seahub-data/ # seahub data
└── seahub.db # seahub sqlite3 database
└── seahub_settings.py # custom settings for seahub
└── seafile-server└── seahub/└── seafile-{VERSION} # seafile source code

Start the Seafile Server

After configuration successfully created, run seafile-admin start in the top directory to start the all components of Seafile. ( You should always run the seafile-admin script in the top directory ).

+

cd /data/haiwen # go to the top level directory
seafile-admin start

At this moment, all the components should be running and seahub can be visited at http://yourserver-ip-or-domain:8000

+

Note You may want to deploy seahub with nginx or apache. In this case, follow the instructions on Deploy Seafile Web With Nginx/Apache.

+

Stop the Seafile Server

To stop seafile server, run seafile-admin stop.

+

cd /data/haiwen # go to the top level directory
seafile-admin stop

Upgrade the Seafile Server

When you want to upgrade to a new vesrion of seafile server, you need to:

+

  • Stop the seafile server if it's running
cd /data/haiwen
seafile-admin stop
  • Get and latest source code and build libsearpc/ccnet/seafile, just as what you do in a fresh setup.
  • Run the upgrade script. The upgrade script mainly updates database used by seafile for you. For example, create a new database table that is used in the latest seafile server but not in the previous version.

Get and compile the latest libsearpc/ccnet/seafile

See the Building section above.

+

Get the new seahub tarball and uncompress it

cd haiwen/seafile-server
mv seahub/ seahub-old # move away the old seahub folder
tar xf /path/to/new/seahub-x.x.x-server.tar.gz
mv seahub-x.x.x-server seahub

Do the upgrade

  • copy the scripts/upgrade/ subdir outside

The upgrade scripts is distributed in the scripts/upgrade subdir of seafile source code, we need to copy it to seafile-server directory before run the scripts.

+

cd /data/haiwen/seafile-server
cp -rf seafile-{version}/scripts/upgrade .
Continuous Upgrade (like from 1.1 to 1.2)

Continuous upgrade means to upgrade from one version of seafile server to the next version. For example, upgrading from 1.1.0 to 1.2.0 is a continuous upgrade.

+

Note: Minor upgrade, like upgrade from 1.3.0 to 1.3.1, is documented in a separate section below.

+

Say you are upgrading from 1.1.0 to 1.2.0, you should run the script upgrade_1.1_1.2.sh in seafile-server directory.

+

cd /data/haiwen/seafile-server
./upgrade/upgrade_1.1_1.2.sh
Non-continous version upgrade(like from 1.1 to 1.3)

If you upgrade a few versions at once, e.g. from 1.1.0 to 1.3.0. The procedure is:

+

  • upgrade from 1.1.0 to 1.2.0
  • upgrade from 1.2.0 to 1.3.0

Just run the upgrade scripts in sequence.

+

Minor Upgrade (like from 1.3.0 to 1.3.1)

Minor upgrade Minor upgrade is like an upgrade from 1.3.0 to 1.3.1. For this type of upgrade, you only need to update the avatar link:

+

cd /data/haiwen/seafile-server/seahub/media
cp -rf avatars/* ../../../seahub-data/avatars/
rm -rf avatars
ln -s ../../../seahub-data/avatars

Problems Report

If you encounter any problem when building/deploying Seafile, please leave us a message or open an issue.





这篇关于源码安装seafile的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1018646

相关文章

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7

Centos7安装Mongodb4

1、下载源码包 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz 2、解压 放到 /usr/local/ 目录下 tar -zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgzmv mongodb-linux-x86_64-rhel70-4.2.1/

JAVA智听未来一站式有声阅读平台听书系统小程序源码

智听未来,一站式有声阅读平台听书系统 🌟 开篇:遇见未来,从“智听”开始 在这个快节奏的时代,你是否渴望在忙碌的间隙,找到一片属于自己的宁静角落?是否梦想着能随时随地,沉浸在知识的海洋,或是故事的奇幻世界里?今天,就让我带你一起探索“智听未来”——这一站式有声阅读平台听书系统,它正悄悄改变着我们的阅读方式,让未来触手可及! 📚 第一站:海量资源,应有尽有 走进“智听

Centos7安装JDK1.8保姆版

工欲善其事,必先利其器。这句话同样适用于学习Java编程。在开始Java的学习旅程之前,我们必须首先配置好适合的开发环境。 通过事先准备好这些工具和配置,我们可以避免在学习过程中遇到因环境问题导致的代码异常或错误。一个稳定、高效的开发环境能够让我们更加专注于代码的学习和编写,提升学习效率,减少不必要的困扰和挫折感。因此,在学习Java之初,投入一些时间和精力来配置好开发环境是非常值得的。这将为我

安装nodejs环境

本文介绍了如何通过nvm(NodeVersionManager)安装和管理Node.js及npm的不同版本,包括下载安装脚本、检查版本并安装特定版本的方法。 1、安装nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash 2、查看nvm版本 nvm --version 3、安装

Java ArrayList扩容机制 (源码解读)

结论:初始长度为10,若所需长度小于1.5倍原长度,则按照1.5倍扩容。若不够用则按照所需长度扩容。 一. 明确类内部重要变量含义         1:数组默认长度         2:这是一个共享的空数组实例,用于明确创建长度为0时的ArrayList ,比如通过 new ArrayList<>(0),ArrayList 内部的数组 elementData 会指向这个 EMPTY_EL

如何在Visual Studio中调试.NET源码

今天偶然在看别人代码时,发现在他的代码里使用了Any判断List<T>是否为空。 我一般的做法是先判断是否为null,再判断Count。 看了一下Count的源码如下: 1 [__DynamicallyInvokable]2 public int Count3 {4 [__DynamicallyInvokable]5 get

计算机毕业设计 大学志愿填报系统 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点赞 👍 收藏 ⭐评论 📝 🍅 文末获取源码联系 👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~Java毕业设计项目~热门选题推荐《1000套》 目录 1.技术选型 2.开发工具 3.功能

SWAP作物生长模型安装教程、数据制备、敏感性分析、气候变化影响、R模型敏感性分析与贝叶斯优化、Fortran源代码分析、气候数据降尺度与变化影响分析

查看原文>>>全流程SWAP农业模型数据制备、敏感性分析及气候变化影响实践技术应用 SWAP模型是由荷兰瓦赫宁根大学开发的先进农作物模型,它综合考虑了土壤-水分-大气以及植被间的相互作用;是一种描述作物生长过程的一种机理性作物生长模型。它不但运用Richard方程,使其能够精确的模拟土壤中水分的运动,而且耦合了WOFOST作物模型使作物的生长描述更为科学。 本文让更多的科研人员和农业工作者