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.
The following libraries need to be compiled from source.
libzdb relies on two packages: re2c
and flex
.
libevhtp can be build by cmake .; make; sudo make install
. libevhtp's version should be 1.1.6 or 1.1.7.
'''Seahub''' is the web front end of Seafile. It's written in the [http://djangoproject.com django] framework. Seahub requires Python 2.6(2.7) installed on your server, and it needs the following python libraries:
The module '''argparser''' is required by the seafile-admin
script which you'll see later. If you use Python 2.7, '''argparser''' is distributed with python's standard library, so you don't need to install it. But if you use Python 2.6, you should install it manually.
Before continue, make sure you have all the above libraries available in your system.
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:
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
First you should get the latest source of libsearpc/ccnet/seafile/seahub
Download the source tarball of the latest tag from
For example, if the latest released seafile client is 2.0.3, then just use the '''v2.0.3-server''' tags of the four projects. You should get four tarballs:
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-2.0.3-server.tar.gz tar xf /path/to/ccnet-2.0.3-server.tar.gz tar xf /path/to/seafile-2.0.3-server.tar.gz
And uncompress seahub tarball to haiwen/seafile-server
:
cd haiwen/seafile-server tar xf /path/to/seahub-2.0.3-server.tar.gz mv seahub-2.0.3-server seahub
So far, The current directory layout is:
haiwen/ └── seafile-server └── seahub └── src ├── libsearpc-2.0.3-server ├── ccnet-2.0.3-server ├── seafile-2.0.3-server ├── ... (other files)
To build seafile server, you need first build '''libsearpc''' and '''ccnet'''.
cd libsearpc-${version} ./autogen.sh ./configure make make install
cd ccnet-${version} ./autogen.sh ./configure --disable-client --enable-server # `export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig` if libsearpc is not found make make install
cd seafile-${version} ./autogen.sh ./configure --disable-client --enable-server make make install
The seafile server consists of the following components:
Process Name | Functionality |
---|---|
ccnet-server | underlying networking |
seaf-server | data management |
Seahub | website front-end of seafile server |
fileserver | handles raw file upload/download for Seahub |
[[images/server-arch.png]]
ccnet
.seafile-data
.syncdb
command must be run to create all the database tables.These are the essential steps to create the configuration:
To create the configurations, you can either:
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 exit subcommands: {setup,start,stop,reset-admin} setup setup the seafile server start start the seafile server stop stop the seafile server reset-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.
Name | Usage | Default | Requirement |
---|---|---|---|
server name | The name of the server that would be shown on the client | 3 ~ 15 letters or digits | |
ip or domain | The 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 port | the tcp port used by ccnet | 10001 | |
seafile port | tcp port used by seafile | 12001 | |
seafile fileserver port | tcp port used by seafile fileserver | 8082 | |
admin email | Email address of the admin account | ||
admin password | password of the admin account |
This is a screenshot of the '''seafile-admin setup''' command: [[images/seafile-admin-1.png]]
And a screenshot after setup is finished successfully: [[images/seafile-admin-2.png]]
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
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]].
To stop seafile server, run '''seafile-admin stop'''.
cd /data/haiwen # go to the top level directory seafile-admin stop
When you want to upgrade to a new vesrion of seafile server, you need to:
cd /data/haiwen seafile-admin stop
See the '''Building''' section above.
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
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 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
If you upgrade a few versions at once, e.g. from 1.1.0 to 1.3.0. The procedure is:
Just run the upgrade scripts in sequence.
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
If you encounter any problem when building/deploying Seafile, please leave us a message or [https://github.com/haiwen/seafile/issues open an issue].