Setup Seafile Server Development Environment

install necessary packages by apt

install libevhtp from source

  1. cd ~/Downloads/
  2. git clone https://github.com/haiwen/libevhtp.git
  3. cd libevhtp/
  4. cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
  5. sudo make install
  6. sudo ldconfig

create project root directory dev

  1. cd
  2. mkdir dev

download and install libsearpc

  1. cd ~/dev/
  2. git clone https://github.com/haiwen/libsearpc.git
  3. cd libsearpc/
  4. ./configure
  5. make
  6. sudo make install
  7. sudo ldconfig

download and install ccnet-server

download and install seafile-server

  1. cd ~/dev/
  2. git clone https://github.com/haiwen/seafile-server.git
  3. cd seafile-server/
  4. ./autogen.sh
  5. ./configure
  6. make
  7. sudo make install

download seahub

  1. git clone https://github.com/haiwen/seahub.git
  2. cd seahub/

Start ccnet-server and seaf-server in two separate terminals.

  1. cd ~/dev/seafile-server/tests
  2. ccnet-server -c conf -f -

Seahub is the web front end of Seafile. It is written in the Django framework, requires Python 2.7 installed on your server.

set environment

  1. cd ~/dev/seahub/
  2. cat > setenv.sh << EOF
  3. export CCNET_CONF_DIR=~/dev/seafile-server/tests/conf
  4. export SEAFILE_CONF_DIR=~/dev/seafile-server/tests/conf/seafile-data
  5. export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:thirdpart:\$PYTHONPATH
  6. EOF
  7. sudo chmod u+x setenv.sh

install requirements

  1. # Expand setenv.sh in the current shell
  2. . setenv.sh
  3. cd ~/dev/seahub/
  4. sudo pip install -r requirements.txt

create database and admin account

  1. . setenv.sh
  2. python manage.py migrate

NOTE: currently, your ccnet directory is ~/dev/seafile-server/tests/conf

run seahub

If you have set up Nginx/Apache to run Seafile, you should run seahub in fastcgi mode.

  1. python manage.py runfcgi host=127.0.0.1 port=8000