Tested for Ubuntu 18.04
Install prerequisites
apt-get install sqlite3 ffmpeg python2.7 libpython2.7 python-setuptools python-ldap python-urllib3 python-pip python-requests
pip install Pillow==4.3.0
pip install moviepy # used in movie file thumbnails
enable apache modules
a2enmod proxy_http
Add new seperate user
adduser seafile --system --home /var/seafile --disabled-login --group
usermod -a -G fuse seafile
Setup a directory
mkdir /var/seafile
cd /var/seafile
Download files (https://www.seafile.com/en/download/)
wget https://download.seadrive.org/seafile-server_6.3.4_x86-64.tar.gz
tar -xzf seafile-server_*
cd seafile-server-*
Change ownership
chown -R seafile:seafile /var/seafile
Run installation
sudo -u seafile ./setup-seafile.sh
TODO: install + more config details
Configurations
nano /var/seafile/conf/ccnet.conf
[General]
USER_NAME = MYseafile
ID = IDIDIDIDIDID
NAME = MYseafile
SERVICE_URL = https://seafile.example.net
[Network]
#default 10001
PORT = 10001
nano /var/seafile/seahub_settings.py
SECRET_KEY = "SECRETKEY"
FILE_SERVER_ROOT = 'https://seafile.example.net/seafhttp'
EMAIL_USE_TLS = True
EMAIL_HOST = 'mail.example.net'
EMAIL_HOST_USER = 'seafile@example.net'
EMAIL_HOST_PASSWORD = 'PASSWORD'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'seafile@example.net'
SERVER_EMAIL = 'seafile@example.net'
nano /etc/apache2/apache2.conf
# SeaFile #########################################################
<VirtualHost *:80>
ServerName seafile.example.net
Redirect "/" "https://seafile.example.net/"
</VirtualHost>
<VirtualHost *:443>
ServerName seafile.example.net
DocumentRoot /var/www
RewriteEngine on
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/seafile.example.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/seafile.example.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/seafile.example.net/chain.pem
Alias /media /var/seafile/seafile-server-latest/seahub/media
<Location /media>
ProxyPass !
Require all granted
</Location>
#SeaFile FileServer
ProxyPass /seafhttp http://127.0.0.1:9103
ProxyPassReverse /seafhttp http://127.0.0.1:9103
RewriteRule ^/seafhttp - [QSA,L]
#SeaFile WebDAV
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ProxyPass /seafdav http://127.0.0.1:9105/seafdav/
ProxyPassReverse /seafdav http://127.0.0.1:9105/seafdav/
#SeaHub
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ProxyPassMatch ^/.well-known/acme-challenge/ !
ProxyPass / http://127.0.0.1:9101/
ProxyPassReverse / http://127.0.0.1:9101/
CustomLog /var/log/apache2/seafile_access.log defaultcombined
ErrorLog /var/log/apache2/seafile_error.log
LogLevel warn
</VirtualHost>
#####################################################################
FUSE: Allow (non-root) users to use options allow_other, allow_root:
Edit /etc/fuse.conf
and uncomment user_allow_other
/etc/systemd/system/seafile.service
[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target
[Service]
Type=forking
ExecStart=/var/seafile/seafile-server-latest/seafile.sh start
ExecStop=/var/seafile/seafile-server-latest/seafile.sh stop
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
/etc/systemd/system/seahub.service
[Unit]
Description=Seafile hub
After=network.target seafile.service
[Service]
Type=forking
ExecStart=/var/seafile/seafile-server-latest/seahub.sh start
ExecStop=/var/seafile/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
/etc/systemd/system/seafuse.service
[Unit]
Description=Seafile FUSE
After=network.target seafile.service
[Service]
Type=forking
ExecStart=/var/seafile/seafile-server-latest/seaf-fuse.sh start -o ro,allow_other /var/seafile/fuse
ExecStop=/var/seafile/seafile-server-latest/seaf-fuse.sh stop
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
Enable Services (start on boot)
systemctl enable seafile.service
systemctl enable seahub.service
systemctl enable seafuse.service
systemctl start seafile.service
systemctl start seahub.service
systemctl start seafuse.service
nano /var/seafile/myscripts/cleanup.sh
#!/bin/bash
# stop the server
echo Stopping the Seafile-Server...
systemctl stop seafuse
systemctl stop seahub
systemctl stop seafile
echo Giving the server some time to shut down properly....
sleep 20
# run the cleanup
echo Seafile cleanup started...
sudo -u seafile /var/seafile/seafile-server-latest/seaf-gc.sh
echo Giving the server some time....
sleep 10
# start the server again
echo Starting the Seafile-Server...
systemctl start seafile
systemctl start seahub
systemctl start seafuse
echo Seafile cleanup done!
sudo chmod +x /var/seafile/myscripts/cleanup.sh
sudo crontab -e