Ubuntu-16.04.1-desktop-amd64 上建立 Seafile 开发环境

First prepare a clean ubuntu-16.04.1-desktop-amd64 system.

Install Necessary Packages

  • udpate source
sudo apt update
sudo apt upgrade
  • install necessary packages by apt
sudo apt install ssh libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev python-dateutil cmake re2c flex sqlite3 python-pip python-simplejson git libssl-dev libldap2-dev
  • install libevhtp from source
cd ~/Downloads/
wget https://github.com/haiwen/libevhtp.git
cd libevhtp/
cmake -DEVHTP_DISABLE_SSL=OFF -DEVHTP_BUILD_SHARED=ON .
make
sudo make install
  • install libzdb from source
cd ~/Downloads/
wget http://tildeslash.com/libzdb/dist/libzdb-3.1.tar.gz
tar xf libzdb-3.1.tar.gz
cd libzdb-3.1/
./configure
make
sudo make install

Download and Build Seafile

  • create project root directory dev
cd 
mkdir dev
  • download and install libsearpc
cd ~/dev/
git clone https://github.com/haiwen/libsearpc.git
cd libsearpc/
./autogen.sh
./configure
make
sudo make install
  • download and install ccnet
cd ~/dev/
git clone https://github.com/haiwen/ccnet.git
cd ccnet/
git checkout -b v6.0.0-server v6.0.0-server
./autogen.sh
./configure --disable-client --enable-server --enable-ldap
make
sudo make install
sudo ldconfig
  • download and install seafile
cd ~/dev/
git clone https://github.com/haiwen/seafile.git
cd seafile/
git checkout -b v6.0.0-server v6.0.0-server
./autogen.sh
./configure --disable-client --enable-server
make
sudo make install
  • download seahub
cd ~/dev/
git clone https://github.com/haiwen/seahub.git
cd seahub/
git checkout -b v6.0.0-server v6.0.0-server

Start ccnet-server and seaf-server

cd ~/dev/seafile/tests/basic
./seafile.sh 2

NOTE: if error while loading shared libraries: libzdb.so.11: cannot open shared object file: No such file or directory, you should sudo ldconfig

Start Seahub

  • install requirements
cd ~/dev/seahub/
sudo pip install -r requirements.txt

NOTE: if locale.Error: unsupported locale setting, you should export LC_ALL=en_US.UTF-8

  • set environment
cd ~/dev/seahub/

cat > setenv.sh << EOF
export CCNET_CONF_DIR=/home/plt/dev/seafile/tests/basic/conf2
export SEAFILE_CONF_DIR=/home/plt/dev/seafile/tests/basic/conf2/seafile-data
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:thirdpart:$PYTHONPATH
EOF

NOTE: change plt to your linux user name

  • create database and admin account
. setenv.sh
python manage.py migrate
python tools/seahub-admin.py

NOTE: currently, your ccnet directory is /home/plt/dev/seafile/tests/basic/conf2

  • run seahub
python manage.py runserver 0.0.0.0:8000

then open browser and navigate to http://127.0.0.1:8000

感谢楼主的分享。我在centos7中部署了seafile-6.0.8版本程序,然后现在修改了/seahub/templates/snippets/file_share_popup.html页面,重启后,也没效果。请问我需要怎么操作,才能让修改后的代码生效。

在安装libevhtp 地方有问题,最新的安装教程中已经修改了cmake的参数,
cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF . 详见https://manual.seafile.com/build_seafile/server.html#libevhtp

使用楼主的命令会在make seafile server的时候报错。今天踩了坑了,希望后面的同学可以避免这个错误。