Deploy Seafile with Apache


Install mod_fastcgi

Download [mod_fastcgi-*.dll] ( first, and put it into the modules/ directory of your Apache installation.

Note: You must download the right version of mod_fastcgi DLL according for your Apache. For example:

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 using fastcgi, and deploy FileServer with reverse proxy. We assume you are running Seahub using domain ''''''.

Edit httpd.conf

First edit your httpd.conf. Add the following lines to the end of the file:

LoadModule fastcgi_module modules/mod_fastcgi-2.4.6-AP22.dll
LoadModule rewrite_module modules/
LoadModule proxy_module modules/
LoadModule proxy_http_module modules/
Include conf/extra/httpd-vhosts.conf

Then add this line (substitute YourDocumentRoot with the value of your apache DocumentRoot)

FastCGIExternalServer "YourDocumentRoot/seahub.fcgi" -host

Note, seahub.fcgi is just a placeholder, you don't need to actually have this file in your system.

Edit your httpd-vhosts.conf

Assume you have uncompresssed seafile server into C:/SeafileProgram/seafile-pro-server-2.1.4.

<VirtualHost *:80>
  Alias /media  "C:/SeafileProgram/seafile-pro-server-2.1.4/seahub/media"

  RewriteEngine On

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

  # seahub
  RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ /seahub.fcgi$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

<Directory "C:/SeafileProgram/seafile-pro-server-2.1.4/seahub/media">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

Modify Configurations

Modify ccnet.conf

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.

Modify seafile-data/seafile.conf

Modify the seahub section of seafile-data/seafile.conf:



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.)


Notes when Upgrading Seafile Server

When upgrading seafile server, besides the normal steps you should take, there is one extra step to do: '''Update the path of the static files in your apache configuration'''. For example, assume your are upgrading seafile server 2.1.4 to 2.1.5, then:

<VirtualHost *:80>
  Alias /media  "C:/SeafileProgram/seafile-pro-server-2.1.5/seahub/media"

<Directory "C:/SeafileProgram/seafile-pro-server-2.1.5/seahub/media">

results matching ""

    No results matching ""