Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:seafile

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
wiki:seafile [2022/08/20 15:50] – angelegt mhowiki:seafile [2022/08/22 18:10] (aktuell) mho
Zeile 1: Zeile 1:
-How To Configure Seafile Server on Debian 11 / Debian 10 -By Klinsmann ÖteyoDecember 24, 2021 Modified date: December 24, 202127040+<code> 
 +apt update && apt install mariadb-server mariadb-client 
 +</code>
  
-Welcome to this guide on how to install and configure Seafile Server on Debian 11 / Debian 10. Seafile is a self-hosted, open-source, and highly reliable file synchronization and sharing platform. Using Seafile, you can easily share files using the cross-platform syncing and password-protected links with expiration dates. Files can be put in a separate own server and allow other devices to sync and access it. +mysql_secure_installation 
- +witch to unix_socket authentication [Y/n] n
-Features associated with Seafile are: +
- +
-    It is easy to upgrade – upgrading Seafile can be done by running a simple script and takes a few seconds +
-    Highly reliable with high performance as it is built in C programming. +
-    Drive Client: it allows one to access files in the cloud in local S: drive without syncing them. +
-    File Locking +
-    File Versioning and Snapshot that allows files and folders to be restored to older versions +
-    Easily integrates with other applications. +
-    File Sharing and Permission Control +
-    It offers backup and data Recovery +
-    Cross Platform File Syncing with mobile file access through android and iOS devices. +
-    Faster data retrieval and knowledge management. +
-    It offers online editing and co-authoring +
- +
-Getting Started +
- +
-For this guide, ensure that your system meets the below requirements: +
- +
-    Database server – MySQL / MariaDB server +
-    Python Tools +
-    HTTP Server – Nginx or Apache +
- +
-First, we will begin by fulfilling the stated requirements before we dive into the crux of the matter. +
-1. Install and Configure MariaDB Database Server +
- +
-In this guide, we will use MariaDB as our database server. MariaDB can be installed on Debian 11 / Debian 10 as below. +
- +
-sudo apt update +
-sudo apt install mariadb-server mariadb-client +
- +
-Harden the MariaDB instance on your system. +
- +
-sudo mysql_secure_installation +
- +
-Proceed as below. +
- +
-Enter current password for root (enter for none): Press Enter +
-.... +
-Switch to unix_socket authentication [Y/n] n +
-.......+
 Change the root password? [Y/n] y Change the root password? [Y/n] y
-New password: Enter Password 
-Re-enter new password: Re-Enter Password 
-...... 
 Remove anonymous users? [Y/n] y Remove anonymous users? [Y/n] y
-... 
 Disallow root login remotely? [Y/n] y Disallow root login remotely? [Y/n] y
-... 
 Remove test database and access to it? [Y/n] y Remove test database and access to it? [Y/n] y
-.... 
 Reload privilege tables now? [Y/n] y Reload privilege tables now? [Y/n] y
-..... 
-Thanks for using MariaDB! 
  
-Now login to the MariaDB shell using the created root password.+<code> 
 +mysql -u root -p
  
-$ mysql -u root -p +CREATE USER 'seafile'@'localhostIDENTIFIED BY 'mein_Passwort';
-Enter password:  +
-Welcome to the MariaDB monitor.  Commands end with ; or \g. +
-Your MariaDB connection id is 48 +
-Server version: 10.3.11-MariaDB-1:10.3.11+maria~bionic-log mariadb.org binary distribution +
- +
-Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. +
- +
-Type 'help;or '\hfor help. Type '\cto clear the current input statement. +
- +
-MariaDB [(none)]> +
- +
-We now ant to configure the Seafile database. There are 3 components of Seafile that need their own database: +
- +
-    seafile server +
-    ccnet server +
-    seahub server +
- +
-We will proceed and create a database for each of these components as below.+
  
 +CREATE DATABASE ccnet_server;
 CREATE DATABASE seafile_server; CREATE DATABASE seafile_server;
-CREATE DATABASE ccnet_server; 
 CREATE DATABASE seahub_server; CREATE DATABASE seahub_server;
- 
-Create a Seafile database user with the appropriate grants to the databases above. 
- 
-CREATE USER 'seafile'@'localhost' IDENTIFIED BY 'Passw0rd'; 
 GRANT ALL ON seafile_server.* TO 'seafile'@'localhost'; GRANT ALL ON seafile_server.* TO 'seafile'@'localhost';
 GRANT ALL ON ccnet_server.* TO 'seafile'@'localhost'; GRANT ALL ON ccnet_server.* TO 'seafile'@'localhost';
 GRANT ALL ON seahub_server.* TO 'seafile'@'localhost'; GRANT ALL ON seahub_server.* TO 'seafile'@'localhost';
-QUIT;+quit;
  
-Confirm if you can log in using the created Seafile user. 
  
-$ mysql -u seafile -pPassw0rd +apt install python3 python3-{pip,pil,ldap,urllib3,setuptools,mysqldb,memcache,requests} 
-Welcome to the MariaDB monitor.  Commands end with ; or \g. +apt install ffmpeg memcached libmemcached-dev 
-Your MariaDB connection id is 55 +pip3 install --upgrade pip 
-Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11+pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy==1.4.
 +pip3 install --timeout=3600 django-pylibmc django-simple-captcha python3-ldap mysqlclient
  
-Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.+cd /srv/ 
 +mkdir seafile 
 +cd seafile
  
-Type 'help;' or '\h' for helpType '\c' to clear the current input statement.+wget https://download.seadrive.org/seafile-server_8.0.7_x86-64.tar.gz
  
-MariaDB [(none)]> +tar -zxvf seafile-server_8.0.7_x86-64.tar.gz
  
-On successful login, show available databases:+cd seafile-server-8.0.7
  
-MariaDB [(none)]> SHOW DATABASES; +bash setup-seafile-mysql.sh 
-+--------------------+ +</code> 
-| Database           | +[ server name ] Seafile 
-+--------------------+ +[ This server's ip or domain ] your_domain oder 192.168.178.x
-| ccnet_server       | +
-| information_schema | +
-| seafile_server     | +
-| seahub_server      | +
-+--------------------+ +
-4 rows in set (0.000 sec)+
  
-MariaDB [(none)]QUIT +default "/home/<username>/seafile/seafile-data" ] /srv/seafile/seafile-data 
-Bye+[ default "8082" ]
  
-2. Install Python and Dependencies. 
- 
-Python and its modules are also required for Seafile to run on Debian 11 / Debian 10. 
- 
-Install Python and its dependencies on Debian 11 / Debian 10. 
- 
-sudo apt update 
-sudo apt install python3 python3-{pip,pil,ldap,urllib3,setuptools,mysqldb,memcache,requests} 
-sudo apt install ffmpeg memcached libmemcached-dev 
-sudo pip3 install --upgrade pip 
-sudo pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 
-sudo pip3 install --timeout=3600 django-pylibmc django-simple-captcha python3-ldap mysqlclient 
- 
-3. Install Seafile Server on Debian 11 / Debian 10 
- 
-Seafile is downloaded by visiting the official Seafile release page. From the page, download Seafile Server for Linux. 
- 
-Alternatively, you can download the file using Wget by first exporting the latest version available as below. 
- 
-export VER="9.0.2" 
- 
-Now pull the Seafile archive as below. 
- 
-wget https://download.seadrive.org/seafile-server_${VER}_x86-64.tar.gz 
- 
-Once the download is successful, extract the archive and move it to the /srv directory. 
- 
-tar -xvf seafile-server_${VER}_x86-64.tar.gz 
-sudo mv seafile-server-${VER} /srv/seafile 
- 
-Now to execute the setup-seafile-mysql.sh script. 
- 
-cd /srv/seafile/ 
-sudo ./setup-seafile-mysql.sh 
- 
-Proceed and set up Seafile with MySQL as shown. 
- 
-Checking python on this machine ... 
- 
------------------------------------------------------------------ 
-This script will guide you to setup your seafile server using MySQL. 
-Make sure you have read seafile server manual at 
- 
-        https://download.seafile.com/published/seafile-manual/home.md 
- 
-Press ENTER to continue 
------------------------------------------------------------------ 
-What is the name of the server? It will be displayed on the client. 
-3 - 15 letters or digits 
-[ server name ] seafile-server 
- 
-What is the ip or domain of the server? 
-For example: www.mycompany.com, 192.168.1.101 
-[ This server's ip or domain ] seafileserver.example.com 
-Which port do you want to use for the seafile fileserver? 
-[ default "8082" 
- 
-------------------------------------------------------- 
-Please choose a way to initialize seafile databases: 
-------------------------------------------------------- 
- 
-[1] Create new ccnet/seafile/seahub databases 
 [2] Use existing ccnet/seafile/seahub databases [2] Use existing ccnet/seafile/seahub databases
  
-[ 1 or 2 ] 2 
-What is the host of mysql server? 
-[ default "localhost" ] Press Enter 
- 
-What is the port of mysql server? 
-[ default "3306" ] Press Enter 
- 
-Which mysql user to use for seafile? 
 [ mysql user for seafile ] seafile [ mysql user for seafile ] seafile
-What is the password for mysql user "seafile"? 
-[ password for seafile ] Passw0rd 
- 
-verifying password of user seafile ...  done 
  
-Enter the existing database name for ccnet: 
 [ ccnet database ] ccnet_server [ ccnet database ] ccnet_server
 +[ seafile database ] seafile_server
 +[ seahub database ] seahub_server
  
-verifying user "seafileaccess to database ccnet_server ...  done+<code> 
 +echo "export LC_ALL=de_DE.UTF-8>>~/.bashrc 
 +echo "export LANG=de_DE.UTF-8" >>~/.bashrc 
 +echo "export LANGUAGE=de_DE.UTF-8" >>~/.bashrc 
 +source ~/.bashrc 
 +</code> 
 +Configuring the Apache Web Server
  
-Enter the existing database name for seafile: +In this step, you will configure the Apache web server to forward all requests to Seafile. Using Apache in this manner allows you to use a URL without a port number, enable HTTPS connections to Seafile, and make use of the caching functionality that Apache provides for better performance.
-[ seafile database ] seafile_server+
  
-verifying user "seafile" access to database seafile_server ...  done+To begin forwarding requests, you will need to enable the proxy_http module in the Apache configurationThis module provides features for proxying HTTP and HTTPS requestsThe following command will enable the module: 
 +<code> 
 +    sudo a2enmod proxy_http 
 +</code> 
 +Note: The Apache rewrite and ssl modules are also required for this setup. You have already enabled these modules as part of configuring Let’s Encrypt in the second Apache tutorial listed in the prerequisites section.
  
-Enter the existing database name for seahub: +Next, update the virtual host configuration of your_domain to forward requests to the Seafile file server and to the Seahub web interface.
-[ seahub database ] seahub_server+
  
-verifying user "seafile" access to database seahub_server ...  done+Open the configuration file in a text editor: 
 +<code> 
 +    sudo nano /etc/apache2/sites-enabled/your_domain-le-ssl.conf 
 +</code> 
 +The lines from ServerAdmin to SSLCertificateKeyFile are part of the initial Apache and Let’s Encrypt configuration that you set up in the prerequisite tutorialsAdd the highlighted content, beginning at Alias and ending with the ProxyPassReverse directive: 
 +/etc/apache2/sites-enabled/your_domain-le-ssl.conf
  
---------------------------------- +<code> 
-This is your configuration +<IfModule mod_ssl.c> 
----------------------------------+<VirtualHost *:443> 
 + ServerAdmin admin@your_email_domain 
 + ServerName your_domain 
 + ServerAlias www.your_domain 
 + DocumentRoot /var/www/your_domain/html 
 + ErrorLog ${APACHE_LOG_DIR}/your_domain-error.log 
 + CustomLog ${APACHE_LOG_DIR}/your_domain-access.log combined
  
-    server name:            seafile-server + Include /etc/letsencrypt/options-ssl-apache.conf 
-    server ip/domain:       seafileserver.example.com+ SSLCertificateFile /etc/letsencrypt/live/your_domain/fullchain.pem 
 + SSLCertificateKeyFile /etc/letsencrypt/live/your_domain/privkey.pem
  
-    seafile data dir:       /srv/seafile-data + Alias /media  /home/<username>/seafile/seafile-server-latest/seahub/media 
-    fileserver port:        8082+ <Location /media> 
 + Require all granted 
 + </Location>
  
-    database:               use existing + # seafile fileserver 
-    ccnet database        ccnet_server + ProxyPass /seafhttp http://127.0.0.1:8082 
-    seafile database      seafile_server + ProxyPassReverse /seafhttp http://127.0.0.1:8082 
-    seahub database       seahub_server + RewriteEngine On 
-    database user:          seafile+ RewriteRule ^/seafhttp - [QSA,L]
  
 + # seahub web interface
 + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
 + ProxyPass / http://127.0.0.1:8000/
 + ProxyPassReverse / http://127.0.0.1:8000/
 +</VirtualHost>
 +</IfModule>
 +</code>
 +The Alias directive maps the URL path your_domain/media to a local path in the file system that Seafile uses. The following Location directive enables access to content in this directory. The ProxyPass and ProxyPassReverse directives make Apache act as a reverse proxy for this host, forwarding requests to / and /seafhttp to the Seafile web interface and file server running on local host ports 8000 and 8082 respectively. The RewriteRule directive passes all requests to /seafhttp unchanged and stops processing further rules ([QSA,L]).
  
---------------------------------- +Save and exit the file.
-Press ENTER to continue, or Ctrl-C to abort +
---------------------------------- +
-Generating ccnet configuration ...+
  
-Generating seafile configuration ...+Test if there are any syntax errors in the virtual host configuration:
  
-done +    sudo apache2ctl configtest
-Generating seahub configuration ...+
  
----------------------------------------- +If it reports Syntax OK, then there are no issues with your configurationRestart Apache for the changes to take effect:
-Now creating ccnet database tables ...+
  
----------------------------------------- +    sudo systemctl restart apache2
----------------------------------------- +
-Now creating seafile database tables ...+
  
----------------------------------------- +You have now configured Apache to act as a reverse proxy for the Seafile file server and SeahubNext, you will update the URLs in Seafile’s configuration before starting the services. 
----------------------------------------- +Step 5 — Updating Seafile’s Configuration and Starting Services
-Now creating seahub database tables ...+
  
-----------------------------------------+As you are now using Apache to proxy all requests to Seafile, you will need to update the URLs in Seafile’s configuration files in the conf directory using a text editor before you start the Seafile service.
  
-creating seafile-server-latest symbolic link ...  done+Open ccnet.conf in a text editor:
  
------------------------------------------------------------------ +    nano /home/<username>/seafile/conf/ccnet.conf
-Your seafile server configuration has been finished successfully. +
------------------------------------------------------------------+
  
-run seafile server    ./seafile.sh { start | stop | restart } +Near the top of the file, within the [General] block, is the SERVICE_URL directive. It will look like this: 
-run seahub  server:     ./seahub.sh  { start <port> | stop | restart <port> }+Update /home/<username/seafile/conf/ccnet.conf
  
------------------------------------------------------------------ +. . . 
-If you are behind a firewall, remember to allow input/output of these tcp ports+SERVICE_URL=http://www.example.com:8000 
------------------------------------------------------------------+. . .
  
-port of seafile fileserver  8082 +Modify this setting to point to your domain. Be sure that the URL you provide uses the HTTPS protocol, and that it does not include any port number
-port of seahub:               8000+Update /home/sammy/seafile/conf/ccnet.conf
  
-When problems occur, Refer to+. . . 
 +SERVICE_URL = https://your_domain 
 +. . .
  
-        https://download.seafile.com/published/seafile-manual/home.md+Save and exit the file once you have added the content.
  
-for information.+Now open seahub_settings.py in a text editor:
  
-Now Seafile server has been configured to run on port 8082 and the Web UI will be available on port 8000. +    nano /home/sammy/seafile/conf/seahub_settings.py
-4. Manage Seafile Services on Debian 11 Debian 10+
  
-Now we will start the Seafile Server daemon that allows us to upload, download and sync files.+Add a FILE_SERVER_ROOT setting in the file to specify the path where the file server is listening for file uploads and downloads: 
 +Update /home/sammy/seafile/conf/seahub_settings.py
  
-$ cd /srv/seafile +# -*- coding: utf-8 -*- 
-$ sudo ./seafile.sh start  +SECRET_KEY = "..." 
-Starting seafile server, please wait ... +FILE_SERVER_ROOT = 'https://your_domain/seafhttp' 
-** Message03:34:20.884: seafile-controller.c(536): No seafevents.+...
  
-Seafile server started+Save and exit seahub_settings.py.
  
-Done.+Now you can start the Seafile service and the Seahub interface:
  
-Proceed and start the Frontend(Seahub Web Interface)+    cd /home/sammy/seafile/seafile-server-8.0.7 
 +    ./seafile.sh start 
 +    ./seahub.sh start
  
-$ sudo ./seahub.sh start  +As this is the first time you have started the Seahub service, it will prompt you to create an admin account. Enter a valid email address and a password for this admin user:
-LC_ALL is not set in ENV, set to en_US.UTF-8 +
-Starting seahub at port 8000 ... +
- +
----------------------------------------- +
-It'the first time you start the seafile server. Now let'create the admin account +
-----------------------------------------+
  
 +Output
 What is the email for the admin account? What is the email for the admin account?
-[ admin email ] admin@techviewleo.com+[ admin email ] admin@your_email_domain
  
 What is the password for the admin account? What is the password for the admin account?
-[ admin password ] Enter Password here +[ admin password ] password-here
- +
-Enter the password again: Re-Enter Password here +
-[ admin password again ]  +
  
 +Enter the password again:
 +[ admin password again ] password-here
  
 ---------------------------------------- ----------------------------------------
Zeile 317: Zeile 190:
 Done. Done.
  
-Incase you have any problems with setting the Locale settings, proceed as below.+Open https://your_domain in a web browser and log in using your Seafile admin email address and password.
  
-echo "export LC_ALL=en_US.UTF-8" >>~/.bashrc +Login screen of the Seafile web interface 
-echo "export LANG=en_US.UTF-8" >>~/.bashrc + 
-echo "export LANGUAGE=en_US.UTF-8" >>~/.bashrc +Once logged in successfully, you can access the admin interface or create new users (<username>).
-source ~/.bashrc+
  
-Manage Seafile as a Sytemd Service.+Now that you have verified the web interface is working correctly, you can enable these services to start automatically at system boot in the next step. 
 +Step 6 — Enabling the Seafile Server to Start at System Boot
  
-Seafile can be managed just like any other systemd service. This will allow us to start, enable,restart Seafile server.+To enable the file server and the web interface to start automatically at boot, you can create their respective systemd service files and activate them.
  
-For the Backend server.+Create a systemd service file for the Seafile file server
 + 
 +    sudo nano /etc/systemd/system/seafile.service 
 + 
 +Add the following content to the file: 
 +Create /etc/systemd/system/seafile.service
  
-sudo tee /etc/systemd/system/seafile.service<<EOF 
 [Unit] [Unit]
 Description=Seafile Description=Seafile
-After= mysql.service +After=network.target mysql.service
-After=network.target+
  
 +<code>
 [Service] [Service]
 Type=forking Type=forking
-ExecStart=/srv/seafile-server-latest/seafile.sh start +ExecStart=/home/<username/seafile/seafile-server-latest/seafile.sh start 
-ExecStop=/srv/seafile-server-latest/seafile.sh stop+ExecStop=/home/<username/seafile/seafile-server-latest/seafile.sh stop 
 +User=<username> 
 +Group=<username>
  
 [Install] [Install]
 WantedBy=multi-user.target WantedBy=multi-user.target
-EOF+</code> 
 +Here, the ExectStart and ExecStop lines indicate the commands that run to start and stop the Seafile service. The service will run with sammy as the User and Group. The After line specifies that the Seafile service will start after the networking and MariaDB service has started. 
 + 
 +Save seafile.service and exit.
  
-For the Frontend server(Seahub)+Create a systemd service file for the Seahub web interface: 
 +<code> 
 +    sudo nano /etc/systemd/system/seahub.service 
 +</code> 
 +This is similar to the Seafile service. The only difference is that the web interface is started after the Seafile service. Add the following content to this file: 
 +<code> 
 +Create /etc/systemd/system/seahub.service
  
-sudo tee  /etc/systemd/system/seahub.service<<EOF 
 [Unit] [Unit]
-Description=Seafile +Description=Seafile hub 
-After= mysql.service +After=network.target seafile.service
-After=network.target+
  
 [Service] [Service]
 Type=forking Type=forking
-ExecStart=/srv/seafile-server-latest/seahub.sh start +ExecStart=/home/<username>/seafile/seafile-server-latest/seahub.sh start 
-ExecStop=/srv/seafile-server-latest/seahub.sh stop+ExecStop=/home/<username>/seafile/seafile-server-latest/seahub.sh stop 
 +User=<username> 
 +Group=<username>
  
 [Install] [Install]
 WantedBy=multi-user.target WantedBy=multi-user.target
-EOF+</code> 
 +Save seahub.service and exit. 
 + 
 +You can learn more about systemd unit files in the Understanding Systemd Units and Unit Files tutorial. 
 + 
 +Finally, to enable both the Seafile and Seahub services to start automatically at boot, run the following commands: 
 +<code> 
 +    sudo systemctl enable seafile.service 
 +    sudo systemctl enable seahub.service 
 +</code> 
 +When the server is rebooted, Seafile will start automatically. 
 + 
 +At this point, you have completed setting up the server, and can now test each of the services. 
 + 
 +***** Testing File Syncing and Sharing Functionality ***** 
 + 
 +In this step, you will test the file synchronization and sharing functionality of the server you have set up and ensure they are working correctly. To do this, you will need to install the Seafile client program on a separate computer and/or a mobile device. 
 + 
 +Visit the download page on the Seafile website and follow the instructions to install the latest version of the client program on your computer. Seafile clients are available for the various distributions of Linux (Ubuntu, Debian, Fedora, Centos/RHEL, Arch Linux), MacOS, and Windows. Mobile clients are available for Android and iPhone/iPad devices from the respective app stores. 
 + 
 +Once you have installed the Seafile client, you can test the file synchronization and sharing functionality.
  
-The services will fail to start, unless you stop the already running services.+Open the Seafile client program on your computer or device. Accept the default location for the Seafile folder and click Next.
  
-cd /srv/seafile +In the next window, enter the server address, username, and password, then click Login.
-sudo ./seafile.sh stop +
-sudo ./seahub.sh stop+
  
-Reload system daemons.+At the home page, right click on My Library and click Sync this library. Accept the default value for the location on your computer or device.
  
-sudo systemctl daemon-reload+Seafile client — Sync the default library
  
-Start and enable Seafile and Seahub to run automatically on boot.+Add a file, for example a document or a photo, into the My Library folder. After some time, the file will upload to the server. The following screenshot shows the file photo.jpg copied to the My Library folder.
  
-sudo systemctl start seafile && sudo systemctl enable seafile +Add a file to the default library from the computer
-sudo systemctl start seahub && sudo systemctl enable seahub+
  
-Check the status of seafile:+Now, log in to the web interface at https://your_domain and verify that your file is present on the server.
  
-$ systemctl status seafile +My Library page to verify file sync
-● seafile.service - Seafile +
-     Loaded: loaded (/etc/systemd/system/seafile.service; enabled; vendor preset: enabled) +
-     Active: active (running) since Wed 2021-12-08 04:22:13 EST; 10s ago +
-    Process: 13695 ExecStart=/srv/seafile-server-latest/seafile.sh start (code=exited, status=0/SUCCESS) +
-   Main PID: 13713 (seafile-control) +
-      Tasks: 1 (limit: 4663) +
-     Memory: 988.0K +
-        CPU: 65ms +
-     CGroup: /system.slice/seafile.service +
-             └─13713 /srv/seafile/seafile/bin/seafile-controller -c /srv/ccnet -d /srv/seafile-data -F /srv/conf+
  
-Dec 08 04:22:10 debian systemd[1]: Starting Seafile... +Click on Share next to the file to generate a download link for this file that you can share.
-Dec 08 04:22:10 debian seafile.sh[13695]: Starting seafile server, please wait ... +
-Dec 08 04:22:10 debian seafile-control[13711]: seafile-controller.c(536): No seafevents. +
-Dec 08 04:22:13 debian seafile.sh[13695]: Seafile server started +
-Dec 08 04:22:13 debian seafile.sh[13695]: Done. +
-Dec 08 04:22:13 debian systemd[1]: Started Seafile.+
  
-Also check the status of Seahub.+Enabling HTTPS with Apache¶
  
-$ systemctl status seahub +After completing the installation of Seafile Server Community Edition and Seafile Server Professional Edition, communication between the Seafile server and clients runs over (unencryptedHTTPWhile HTTP is ok for testing purposesswitching to HTTPS is imperative for production use.
-● seahub.service - Seafile +
-     Loaded: loaded (/etc/systemd/system/seahub.service; disabled; vendor preset: enabled) +
-     Active: active (running) since Wed 2021-12-08 04:26:45 EST; 15s ago +
-    Process: 14200 ExecStart=/srv/seafile-server-latest/seahub.sh start (code=exitedstatus=0/SUCCESS) +
-   Main PID: 14213 (python3) +
-      Tasks: 6 (limit: 4663) +
-     Memory: 58.8M +
-        CPU: 503ms +
-     CGroup: /system.slice/seahub.service +
-             ├─14213 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload +
-             ├─14214 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload +
-             ├─14215 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload +
-             ├─14216 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload +
-             ├─14217 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload +
-             └─14218 python3 /srv/seafile/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /srv/conf/gunicorn.conf.py --preload+
  
-Dec 08 04:26:39 debian systemd[1]: Starting Seafile...+HTTPS requires a SSL certificate from a Certificate Authority (CA)Unless you already have a SSL certificate, we recommend that you get your SSL certificate from Let’s Encrypt using CertbotIf you have a SSL certificate from another CA, skip the section "Getting a Let's Encrypt certificate".
  
-5Configure Nginx Reverse Proxy+A second requirement is a reverse proxy supporting SSL. Apache, a popular web server and reverse proxy, is a good option. The full documentation of Apache is available at https://httpd.apache.org/docs/.
  
-Install Nginx web server on Debian 11 / Debian 10.+The recommended reverse proxy is Nginx. You find instructions for enabling HTTPS with Nginx here. 
 +Setup¶
  
-sudo apt -y install nginx+The setup of Seafile using Apache as a reverse proxy with HTTPS is demonstrated using the sample host name seafile.example.com.
  
-Then create a vitualhost file for Seafile server.+This manual assumes the following requirements:
  
-sudo vim /etc/nginx/conf.d/seafile.conf+    Seafile Server Community Edition/Professional Edition was set up according to the instructions in this manual 
 +    A host name points at the IP address of the server and the server is available on port 80 and 443
  
-In the fileadd the contents below.+If your setup differs from thes requirementsadjust the following instructions accordingly.
  
-server { +The setup proceeds in two stepsFirst, Apache is installedSecond, a SSL certificate is integrated in the Apache configuration
-    listen 80; +Installing Apache¶
-    listen [::]:80; +
-    server_name  seafileserver.example.com; +
-    autoindex off; +
-    client_max_body_size 100M; +
-    access_log /var/log/nginx/seafile.com.access.log; +
-    error_log /var/log/nginx/seafile.com.error.log;+
  
-     location { +Install and enable apache modules: 
-            proxy_pass         http://127.0.0.1:8000; +<code> 
-            proxy_set_header   Host $host; +sudo a2enmod rewrite 
-            proxy_set_header   X-Real-IP $remote_addr; +sudo a2enmod proxy_http 
-            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; +</code> 
-            proxy_set_header   X-Forwarded-Host $server_name; +ImportantDue to the security advisory published by Django team, we recommend to disable GZip compression to mitigate BREACH attackNo version earlier than Apache 2.4 should be used
-            proxy_read_timeout  1200s; +Configuring Apache¶
-        }+
  
-     location /seafhttp { +Modify Apache config file. For CentOS, this is vhost.conf. For Debian/Ubuntu, this is sites-enabled/000-default
-            rewrite ^/seafhttp(.*)$ $1 break; +<code> 
-            proxy_pass http://127.0.0.1:8082; +<VirtualHost *:80> 
-            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; +    ServerName seafile.example.com 
-            proxy_connect_timeout  36000s; +    # Use "DocumentRoot /var/www/html" for CentOS 
-            proxy_read_timeout  36000s; +    # Use "DocumentRoot /var/www" for Debian/Ubuntu 
-            proxy_send_timeout  36000s; +    DocumentRoot /var/www 
-            send_timeout  36000s; +    Alias /media  /opt/seafile/seafile-server-latest/seahub/media
-        }+
  
-    location /media { +    AllowEncodedSlashes On
-            root /srv/seafile-server-latest/seahub; +
-        } +
-}+
  
-Remove the deafult nginx file+    RewriteEngine On
  
-sudo mv /etc/nginx/sites-enabled/default{,.bak}+    <Location /media> 
 +        Require all granted 
 +    </Location>
  
-Restart nginx service by running the following commands:+    # 
 +    # seafile fileserver 
 +    # 
 +    ProxyPass /seafhttp http://127.0.0.1:8082 
 +    ProxyPassReverse /seafhttp http://127.0.0.1:8082 
 +    RewriteRule ^/seafhttp - [QSA,L]
  
-sudo systemctl restart nginx+    # 
 +    # seahub 
 +    # 
 +    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 
 +    ProxyPreserveHost On 
 +    ProxyPass / http://127.0.0.1:8000/ 
 +    ProxyPassReverse / http://127.0.0.1:8000/ 
 +</VirtualHost> 
 +</code> 
 +Getting a Let's Encrypt certificate¶
  
-6Access Seafile Web UI+Getting a Let's Encrypt certificate is straightforward thanks to Certbot. Certbot is a free, open source software tool for requesting, receiving, and renewing Let's Encrypt certificates.
  
-Now proceed and access the Seafile web interface using the URL http://domain_nameYou will be granted the login page below.+First, go to the Certbot website and choose your web server and OS. 
 +Second, follow the detailed instructions then shown.
  
-Enter the set admin username and password and proceed to the Seafile dashboard.+We recommend that you get just a certificate and that you modify the Apache configuration yourself: 
 +<code> 
 +sudo certbot --apache certonly 
 +</code> 
 +Follow the instructions on the screen.
  
-Incase you have a problem “Sorrybut the requested page is unavailable due to server hiccup” Dont worryjust proceed as below.+Upon successful verificationCertbot saves the certificate files in directory named after the host name in /etc/letsencrypt/live. For the host name seafile.example.comthe files are stored in /etc/letsencrypt/live/seafile.example.com. 
 +Adjusting Apache configuration¶
  
-sudo systemctl stop seafile +To use HTTPS, you need to enable mod_ssl: 
-sudo systemctl stop seahub +<code> 
-sudo rm -rf /tmp/seahub_cache +sudo a2enmod ssl 
-sudo reboot -i+</code> 
 +Then modify your Apache configuration file. Here is a sample: 
 +<code> 
 +<VirtualHost *:443> 
 +  ServerName seafile.example.com 
 +  DocumentRoot /var/www
  
-Then proceed and access the dashboard on reboot.+  SSLEngine On 
 +  SSLCertificateFile /etc/letsencrypt/live/seafile.example.com/fullchain.pem;    # Path to your fullchain.pem 
 +  SSLCertificateKeyFile /etc/letsencrypt/live/seafile.example.com/privkey.pem;  # Path to your privkey.pem
  
-Now you can start adding new files by clicking New Library, give it a name, you can as well encrypt it for added security.+  Alias /media  /opt/seafile/seafile-server-latest/seahub/media
  
-Once the new library has been created, there are several options available for you. You can create and edit PPT, EXCEL, Word files e.t.c +  <Location /media> 
-7. Configure Seafile Client+    Require all granted 
 +  </Location>
  
-For this guide, I will demonstrate how to configure Seafile client on Debian 11/debian 10. Login to the Debian 11/Debian 10 server and install Seafile client as below.+  RewriteEngine On
  
-Firt add the Seafile Client repo.+  # 
 +  # seafile fileserver 
 +  # 
 +  ProxyPass /seafhttp http://127.0.0.1:8082 
 +  ProxyPassReverse /seafhttp http://127.0.0.1:8082 
 +  RewriteRule ^/seafhttp - [QSA,L]
  
-sudo wget https://linux-clients.seafile.com/seafile.asc -O /usr/share/keyrings/seafile-keyring.asc +  # 
-sudo bash -c "echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/seafile-keyring.asc] https://linux-clients.seafile.com/seafile-deb/focal/ stable main' > /etc/apt/sources.list.d/seafile.list"+  # seahub 
 +  # 
 +  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 
 +  ProxyPreserveHost On 
 +  ProxyPass / http://127.0.0.1:8000
 +  ProxyPassReverse http://127.0.0.1:8000/ 
 +</VirtualHost> 
 +</code> 
 +Finally, make sure the virtual host file does not contain syntax errors and restart Apache for the configuration changes to take effect: 
 +<code> 
 +sudo service apache2 restart 
 +</code> 
 +Modifying ccnet.conf¶
  
-Install Seafile client on Debian 11/Debian 10.+The SERVICE_URL in ccnet.conf informs Seafile about the chosen domain, protocol and portChange the SERVICE_URLso as to account for the switch from HTTP to HTTPS and to correspond to your host name (the http://must not be removed):
  
-sudo apt update +SERVICE_URL = https://seafile.example.com
-sudo apt install -y seafile-gui+
  
-The commandline Seafile client can be installed as well using the command:+Note: TheSERVICE_URL can also be modified in Seahub via System Admininstration > Settings. If SERVICE_URL is configured via System Admin and in ccnet.conf, the value in System Admin will take precedence. 
 +Modifying seahub_settings.py¶
  
-sudo apt install seafile-cli -y+The FILE_SERVER_ROOT in seahub_settings.py informs Seafile about the location of and the protocol used by the file server. Change the FILE_SERVER_ROOTso as to account for the switch from HTTP to HTTPS and to correspond to your host name (the trailing /seafhttp must not be removed):
  
-Now launch the client from the App Menu.+FILE_SERVER_ROOT = 'https://seafile.example.com/seafhttp'
  
-Set the location to store Seafile libraries.+Note: TheFILE_SERVER_ROOT can also be modified in Seahub via System Admininstration > Settings. If FILE_SERVER_ROOT is configured via System Admin and in seahub_settings.py, the value in System Admin will take precedence. 
 +Modifying seafile.conf (optional)¶
  
-Provide information for the Seafile server to connect to i.e seafile server URL, login username and password+To improve security, the file server should only be accessible via Apache.
  
-On successful authentication, you will see this:+Add the following line in the [fileserver] block on seafile.conf in /opt/seafile/conf: 
 +<code> 
 +host = 127.0.0.1  ## default port 0.0.0.0 
 +</code> 
 +After his change, the file server only accepts requests from Apache. 
 +Starting Seafile and Seahub¶
  
-That is it!+Restart the seaf-server and Seahub for the config changes to take effect: 
 +<code> 
 +su seafile 
 +cd /opt/seafile/seafile-server-latest 
 +./seafile.sh restart 
 +./seahub.sh restart 
 +</code>
wiki/seafile.1661003415.txt.gz · Zuletzt geändert: 2022/08/20 16:50 (Externe Bearbeitung)

Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki