2 instances of seafile on the same server


I need to run 2 instances of seafile on the same server.
Each work fine alone, but seahub doesnot want to start because one is already running.

Is it possible to launch it with a different name ?

sed -i ‘s/CACHE_DIR = “/tmp”/CACHE_DIR = “/tmp/extranet”/’ seafile-server-latest/seahub/seahub/settings.py
mkdir /tmp/extranet

sed -i ‘s/seahub.wsgi/extranethub.wsgi/’ seafile-server-latest/seahub.sh
sed -i ‘s/seahub.wsgi/extranethub.wsgi/’ seafile-server-latest/seahub/bin/start.template
sed -i ‘s/seahub.wsgi/extranethub.wsgi/’ seafile-server-latest/seahub/seahub/settings.py

I get :
Starting seahub at port 8001 …
Error:Seahub failed to start.

Any ideas how to proceed ?


Here is a solution :

sed -i 's/8000/8001/' ccnet.conf
sed -i 's/8000/8001/' gunicorn.conf
sed -i 's/port=8000/port=8001/' seafile-server-latest/seahub.sh
  • change CACHE_DIR
sed -i 's/CACHE_DIR = "/tmp"/CACHE_DIR = "/tmp/extranet"/' seafile-server-latest/seahub/seahub/settings.py
mkdir /tmp/extranet
  • change pgrep -f "seahub.wsgi:application" to pgrep -u <user> -f "seahub.wsgi:application"
sed -i 's/pgrep -f "seahub.wsgi:application"/pgrep -u <user> -f "seahub.wsgi:application"/' seafile-server-latest/seahub.sh

IMHO a cleaner solution is to add

        'default': {
                    'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
                    'LOCATION': '/tmp/seahub_$INSTANCE_cache',
                    'OPTIONS': {
                                    'MAX_ENTRIES': 1000000

to conf/seahub_settings.py

see also: Multiple Seafile instances on one machine

1 Like