Install seafile server + seahub on FreeBSD
After 1.5 days of struggling with different kinds of problems and frustrations I finally succeeded in installing and running seafile on my server(FreeBSD 10.1-RELEASE).
The greatest MISTAKE I made there was to follow the official installation guide for FreeBSD on the seafile server manual page. The preparation step is fine but for FreeBSD >= 10, you can NOT simply build the application from source provided there, because it has a lot of dependencies and will ask for library files FreeBSD does’t have. For example libresolv, which is in the package BIND and BIND is replaced by Unbound(https://www.freebsd.org/doc/en/books/handbook/network-dns.html). Even if you installed BIND, it will not provide the libresolv.so file.
So the correct way to install seafile is to use the ports collection. You need ports net-mgmt/seafile and www/seahub. Make sure you deinstall ccnet first before make install seafile, otherwise the files ccnet-init, ccnet-server and ccnet-servtool in seafile/bin will not be generated and that brings trouble and desperation.
cd /usr/ports/net-mgmt/seafile make config #[x] FUSE cd /usr/ports/www/seahub make config #choose ALL options make install
seahub has a dependency to seafile, so run make install in seahub should be sufficient.
If the installation is successful, you should find everything in /usr/local/www/haiwen/seafile-server
[root@server /usr/local/www/haiwen/seafile-server]# tree --dirsfirst -L 1 . |-- runtime |-- seafile |-- seahub |-- upgrade |-- check_init_admin.py |-- reset-admin.sh |-- seaf-cli-wrapper.sh |-- seaf-fuse.sh |-- seaf-gc.sh |-- seafile.sh |-- seahub.sh |-- setup-seafile-mysql.py |-- setup-seafile-mysql.sh |-- setup-seafile.sh |-- sqlite2mysql.py `-- sqlite2mysql.sh
And the files for ccnet are in seafile/bin.
[root@server /usr/local/www/haiwen/seafile-server/seafile]# tree -L 2 . |-- bin | |-- ccnet-init | |-- ccnet-server | |-- ccnet-servtool | |-- seaf-fsck | |-- seaf-fuse | |-- seaf-migrate | |-- seaf-server | |-- seaf-server-init | |-- seafile-controller | `-- seafserv-gc |-- lib | `-- python2.7 `-- share `-- doc
Run ./setup-seafile.sh to setup seafile-server and seahub.
For configuration with Nginx, just follow the official manual http://manual.seafile.com/deploy/deploy_with_nginx.html but you don’t need to install python-flup, it should already be installed with seahub.
Start with ./seafile.sh start and ./seafile.sh start-fastcgi
If you get any error messages like this: ImportError: No module named <module>, just install the python module with pip install <module> or easy_install <module>, but make sure the versions match those used by seahub.
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.gz:${PORTNAME} \ pip-1.5.6.tar.gz:pip \ pbr-0.10.0.tar.gz:pbr \ lockfile-0.10.2.tar.gz:lockfile \ six-1.8.0.tar.gz:six \ gunicorn-18.0.tar.gz:gunicorn \ flup-1.0.2.tar.gz:flup \ daemon-1.1.tar.gz:daemon \ chardet-2.3.0.tar.gz:chardet \ python-dateutil-2.2.tar.gz:dateutil \ Pillow-2.6.1.zip:Pillow \ Django-1.5.9.tar.gz:Django \ Djblets-0.6.14.tar.gz:Djblets