seafile_server_migration
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| seafile_server_migration [2016/11/02 23:04] – xenadmin | seafile_server_migration [2017/04/10 14:38] (aktuell) – xenadmin | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Seafile Server Migration von Ubuntu 14.04 LTS -> Debian 8 Jessie ====== | ====== Seafile Server Migration von Ubuntu 14.04 LTS -> Debian 8 Jessie ====== | ||
| - | + | ===== Quellen ===== | |
| - | **Quelle:** | + | |
| - https:// | - https:// | ||
| - https:// | - https:// | ||
| - | Auf dem " | + | === Auf dem " |
| <code bash> | <code bash> | ||
| << | << | ||
| + | |||
| mysqldump -h localhost -u root -p seafile_ccnet-db > ccnet-db.sql | mysqldump -h localhost -u root -p seafile_ccnet-db > ccnet-db.sql | ||
| mysqldump -h localhost -u root -p seafile_seafile-db > seafile-db.sql | mysqldump -h localhost -u root -p seafile_seafile-db > seafile-db.sql | ||
| mysqldump -h localhost -u root -p seafile_seahub-db > seahub-db.sql | mysqldump -h localhost -u root -p seafile_seahub-db > seahub-db.sql | ||
| + | |||
| scp -r -P 22 / | scp -r -P 22 / | ||
| scp -r -P 22 / | scp -r -P 22 / | ||
| scp -r -P 22 / | scp -r -P 22 / | ||
| + | |||
| cd / | cd / | ||
| tar -czvf - * | ssh -p 22 root@192.168.1.2 'tar -xhzvf - -C / | tar -czvf - * | ssh -p 22 root@192.168.1.2 'tar -xhzvf - -C / | ||
| </ | </ | ||
| - | Auf dem " | + | |
| + | === Auf dem " | ||
| <code bash> | <code bash> | ||
| apt install python2.7 libpython2.7 python-setuptools python-imaging \ | apt install python2.7 libpython2.7 python-setuptools python-imaging \ | ||
| Zeile 59: | Zeile 62: | ||
| nano / | nano / | ||
| </ | </ | ||
| + | <hidden files.meinekleinefarm.net.conf -edit> | ||
| <file apache files.meinekleinefarm.net.conf> | <file apache files.meinekleinefarm.net.conf> | ||
| + | < | ||
| + | ServerName files.meinekleinefarm.net | ||
| + | Redirect permanent / https:// | ||
| + | </ | ||
| + | |||
| + | < | ||
| < | < | ||
| ServerAdmin webmaster@meinekleinefarm.net | ServerAdmin webmaster@meinekleinefarm.net | ||
| Zeile 67: | Zeile 77: | ||
| DocumentRoot / | DocumentRoot / | ||
| - | SSLEngine | + | SSLEngine |
| - | SSLCertificateFile /opt/seafile/certificates/cacert.pem | + | SSLCertificateFile |
| - | SSLCertificateKeyFile /opt/seafile/certificates/privkey.pem | + | SSLCertificateKeyFile |
| - | SSLCertificateChainFile | + | |
| Alias / | Alias / | ||
| Zeile 81: | Zeile 90: | ||
| RewriteEngine On | RewriteEngine On | ||
| - | # | ||
| # seafile fileserver | # seafile fileserver | ||
| - | # | ||
| ProxyPass /seafhttp http:// | ProxyPass /seafhttp http:// | ||
| ProxyPassReverse /seafhttp http:// | ProxyPassReverse /seafhttp http:// | ||
| RewriteRule ^/seafhttp - [QSA,L] | RewriteRule ^/seafhttp - [QSA,L] | ||
| - | # | ||
| # seahub | # seahub | ||
| - | # | ||
| SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape | SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape | ||
| SetEnvIf Authorization " | SetEnvIf Authorization " | ||
| ProxyPass / fcgi:// | ProxyPass / fcgi:// | ||
| </ | </ | ||
| + | </ | ||
| </ | </ | ||
| + | </ | ||
| + | |||
| <code bash> | <code bash> | ||
| a2ensite files.meinekleinefarm.net.conf | a2ensite files.meinekleinefarm.net.conf | ||
| service apache2 reload | service apache2 reload | ||
| </ | </ | ||
| + | |||
| + | ===== Seafile Server Init Script ===== | ||
| + | <code bash> | ||
| + | nano / | ||
| + | </ | ||
| + | <hidden / | ||
| + | <code bash seafile-server> | ||
| + | #!/bin/sh | ||
| + | |||
| + | ### BEGIN INIT INFO | ||
| + | # Provides: | ||
| + | # Required-Start: | ||
| + | # Required-Stop: | ||
| + | # Default-Start: | ||
| + | # Default-Stop: | ||
| + | # Short-Description: | ||
| + | # Description: | ||
| + | ### END INIT INFO | ||
| + | |||
| + | # Change the value of " | ||
| + | user=seafile | ||
| + | |||
| + | # Change the value of " | ||
| + | # usually the home directory of $user | ||
| + | seafile_dir=/ | ||
| + | script_path=${seafile_dir}/ | ||
| + | seafile_init_log=${seafile_dir}/ | ||
| + | seahub_init_log=${seafile_dir}/ | ||
| + | |||
| + | # Change the value of fastcgi to true if fastcgi is to be used | ||
| + | fastcgi=true | ||
| + | # 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 " | ||
| + | start) | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | if [ $fastcgi = true ]; | ||
| + | then | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | else | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | fi | ||
| + | ;; | ||
| + | restart) | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | if [ $fastcgi = true ]; | ||
| + | then | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | else | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | fi | ||
| + | ;; | ||
| + | stop) | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | sudo -u ${user} ${script_path}/ | ||
| + | ;; | ||
| + | *) | ||
| + | echo " | ||
| + | exit 1 | ||
| + | ;; | ||
| + | esac | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | mkdir -p / | ||
| + | chmod +x / | ||
| + | update-rc.d seafile-server defaults | ||
| + | </ | ||
| + | |||
| + | ===== Garbage Collecting Unused Blocks on Seafile Server ===== | ||
| + | <code bash> | ||
| + | nano / | ||
| + | </ | ||
| + | <hidden / | ||
| + | <code bash seafile-server> | ||
seafile_server_migration.1478127863.txt.gz · Zuletzt geändert: von xenadmin
