I’ve been using Seafile as my personal cloud storage for quite some time now and it’s working really really well. Since I’ve departed quite a bit from the standard setup instructions for the web frontend (Seahub) I’m going to document the setup a tiny little bit.
For complete Seafile setup instructions that include all components and not only the web frontend please refer to the Seafile Server Manual.
Running Seahub as a WSGI application
The standard setup instructions recommend to run Seahub behind Nginx as a FastCGI application. However internally Seahub is actually a WSGI application which is the standard way to communicate with Python based web-applications. Since I’m using uWSGI for managing and running several other services already I opted to skip the FastCGI wrapper in front of Seahub and let uWSGI start the web application with the correct environment instead. This also means
seahub.sh is not used anymore.
The configuration I use for uWSGI and Seafile Server 3.1.6 looks like this:
Most environment variables set here are normally set in
seahub.sh before starting the Python-based HTTP- or FastCGI-Server. The job of configuring the environment is now done by uWSGI and the above configuration file instead. For Python 2.7 the
PYTHONPATH contents obviously need to be adapted.
The only exception in this configuration is
DJANGO_SETTINGS_MODULE which is normally set inside
seahub/wsgi.py early on. Unfortunately this did not seem to work when running the application from uWSGI (probably since the app cannot permanently modify the environment) so I had to set this inside the uWSGI configuration file.
For Nginx the configuration is almost identical to the Seafile FastCGI setup documented in the manual. The only change is that the root location element is a lot simpler and uses
uwsgi_pass instead of