Skip to main content

Seafile Server Installation auf Debian

Vorbereiten von Debian für Seafile:

  • Sicherstellen, dass die locale en_US.UTF-8 vorhanden ist:
sed -i -E 's/^# (en_US\.UTF-8.*)$/\1/' /etc/locale.gen
locale-gen
  • User: seafileserver erstellen
useradd seafileserver
  • als root sudo installieren:
apt-get install sudo -y
  • seafileserver zu Gruppe sudo hinzufügen:
adduser seafileserver sudo


1.1 Seafile Server Setup:

  • Abhängigkeiten installieren:

apt-get -y install mariadb-server python-imaging python-mysqldb python-setuptools nginx
  • nginx konfigurieren
  • in "/home/seafileserver" wechseln
  • Seafile Server Files downloaden und entpacken:

wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_6.0.8_x86-64.tar.gz
 
tar -xvzf seafile-server_6.0.8_x86-64.tar.gz
  • in /home/seafileserver/seafile-server-x.x.x wechseln
  • Seafile Setup starten:

./setup-seafile-mysql.sh
  • Konfiguration

[ server name ] = Name des Servers (wird beim Client angezeigt)
[ This server's ip or domain ] = Domain oder ip des Servers
[ default "/home/seafile/seafile-data" ] = "default"
[ default "8082" ] = "default"
[ 1 or 2 ] = 1
[ default "localhost" ] = "default"
[ default "3306" ] = "default"
[ root password ] = Passwort für mariadb root user
[ default "root" ] = seafileuser
[ password for seafileuser ] = Passwort für seafileuser
[ default "ccnet-db" ] = "default"
[ default "seafile-db" ] = "default"
[ default "seahub-db" ] = "default"
  • Seafile und Seahub Services starten:

./seafile.sh start && ./seahub.sh start
 
[ admin email ] = E-Mail des ersten Admins der Seafile Cloud
[ admin password ] = Passwort für den ersten Admin
[ admin password again ] = ...


Seafile Autostart


  • Datei "Seafile-Server" erstellen:
sudo nano /etc/init.d/seafile-server
 
Inhalt:
 
#!/bin/sh
 
### BEGIN INIT INFO
# Provides:          seafile-server
# Required-Start:    $local_fs $remote_fs $network mysql
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts Seafile Server
# Description:       starts Seafile Server
### END INIT INFO
 
# Change the value of "user" to linux user name who runs seafile
user=seafileserver
 
# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/home/seafileserver
script_path=${seafile_dir}/seafile-server-latest
seafile_init_log=${seafile_dir}/logs/seafile.init.log
seahub_init_log=${seafile_dir}/logs/seahub.init.log
 
# Change the value of fastcgi to true if fastcgi is to be used
fastcgi=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=8000
 
#
# Write a polite log message with date and time
#
echo -e "\n \n About to perform $1 for seafile at `date -Iseconds` \n " >> ${seafile_init_log}
echo -e "\n \n About to perform $1 for seahub at `date -Iseconds` \n " >> ${seahub_init_log}
 
case "$1" in
        start)
                sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
                if [ $fastcgi = true ];
                then
                        sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
                else
                        sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
                fi
        ;;
        restart)
                sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
                if [ $fastcgi = true ];
                then
                        sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
                else
                        sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
                fi
        ;;
        stop)
                sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
                sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
        ;;
        *)
                echo "Usage: /etc/init.d/seafile-server {start|stop|restart}"
                exit 1
        ;;
esac


  • Seafile-Server Skript startbar machen:
sudo chmod +x /etc/init.d/seafile-server
  • rc.d updaten:
sudo update-rc.d seafile-server defaults
  • "seafile.init.log" und "seahub.init.log" löschen:
sudo rm -r /home/seafileserver/logs/seafile.init.log && sudo rm -r /home/seafileserver/logs/seahub.init.log