Skip to content

Config Seahub with Apache


According to the security advisory published by Django team, we recommend disable GZip compression to mitigate BREACH attack.

This tutorial assumes you run at least Apache 2.4.


Install and enable apache modules

On Ubuntu you can use:

sudo a2enmod rewrite
sudo a2enmod proxy_http

Deploy Seahub/FileServer With Apache

Seahub is the web interface of Seafile server. FileServer is used to handle raw file uploading/downloading through browsers. By default, it listens on port 8082 for HTTP request.

Here we deploy Seahub and FileServer with reverse proxy. We assume you are running Seahub using domain ''''''.

Modify Apache config file: (sites-enabled/000-default) for ubuntu/debian, (vhost.conf) for centos/fedora

<VirtualHost *:80>
    # Use "DocumentRoot /var/www/html" for Centos/Fedora
    # Use "DocumentRoot /var/www" for Ubuntu/Debian
    DocumentRoot /var/www
    Alias /media  /home/user/haiwen/seafile-server-latest/seahub/media

    AllowEncodedSlashes On

    RewriteEngine On

    <Location /media>
        Require all granted

    # seafile fileserver
    ProxyPass /seafhttp
    ProxyPassReverse /seafhttp
    RewriteRule ^/seafhttp - [QSA,L]

    # seahub
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ProxyPreserveHost On
    ProxyPass /
    ProxyPassReverse /

Modify ccnet.conf and

Modify ccnet.conf

You need to modify the value of SERVICE_URL in ccnet.conf to let Seafile know the domain you choose. You can also modify SERVICE_URL via web UI in "System Admin->Settings". (Warning: if you set the value both via Web UI and ccnet.conf, the setting via Web UI will take precedence.)


Note: If you later change the domain assigned to seahub, you also need to change the value of SERVICE_URL.


You need to add a line in to set the value of FILE_SERVER_ROOT. You can also modify FILE_SERVER_ROOT via web UI in "System Admin->Settings". (Warning: if you set the value both via Web UI and, the setting via Web UI will take precedence.)


Start Seafile and Seahub

sudo service apache2 restart
./ start
./ start


Problems with paths and files containing spaces

If there are problems with paths or files containing spaces, make sure to have at least Apache 2.4.12.

References * * * *