wiki:seafile
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| wiki:seafile [2022/08/20 15:50] – angelegt mho | wiki:seafile [2022/08/22 18:10] (aktuell) – mho | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | How To Configure Seafile Server on Debian 11 / Debian 10 -> By Klinsmann Öteyo- December 24, 2021 Modified date: December 24, 202127040 | + | <code> |
| + | apt update && apt install mariadb-server mariadb-client | ||
| + | </ | ||
| - | Welcome to this guide on how to install and configure Seafile Server on Debian 11 / Debian 10. Seafile is a self-hosted, | + | 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 | + | |
| - | ....... | + | |
| 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 | + | < |
| + | mysql -u root -p | ||
| - | $ mysql -u root -p | + | CREATE USER 'seafile'@'localhost' |
| - | Enter password: | + | |
| - | Welcome to the MariaDB monitor. | + | |
| - | Your MariaDB connection id is 48 | + | |
| - | Server version: 10.3.11-MariaDB-1: | + | |
| - | + | ||
| - | Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. | + | |
| - | + | ||
| - | Type 'help;' | + | |
| - | + | ||
| - | 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 ' | ||
| GRANT ALL ON seafile_server.* TO ' | GRANT ALL ON seafile_server.* TO ' | ||
| GRANT ALL ON ccnet_server.* TO ' | GRANT ALL ON ccnet_server.* TO ' | ||
| GRANT ALL ON seahub_server.* TO ' | GRANT ALL ON seahub_server.* TO ' | ||
| - | QUIT; | + | quit; |
| - | Confirm if you can log in using the created Seafile user. | ||
| - | $ mysql -u seafile | + | apt install python3 python3-{pip, |
| - | Welcome to the MariaDB monitor. | + | 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.3 |
| + | 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 ' | + | wget https:// |
| - | 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)]> | + | bash setup-seafile-mysql.sh |
| - | +--------------------+ | + | </ |
| - | | Database | + | [ server name ] Seafile |
| - | +--------------------+ | + | [ This server' |
| - | | ccnet_server | + | |
| - | | information_schema | | + | |
| - | | seafile_server | + | |
| - | | seahub_server | + | |
| - | +--------------------+ | + | |
| - | 4 rows in set (0.000 sec) | + | |
| - | MariaDB | + | [ default "/ |
| - | Bye | + | [ default " |
| - | 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, | ||
| - | 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, | ||
| - | |||
| - | export VER=" | ||
| - | |||
| - | Now pull the Seafile archive as below. | ||
| - | |||
| - | wget https:// | ||
| - | |||
| - | 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} / | ||
| - | |||
| - | Now to execute the setup-seafile-mysql.sh script. | ||
| - | |||
| - | cd / | ||
| - | sudo ./ | ||
| - | |||
| - | 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:// | ||
| - | |||
| - | 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, | ||
| - | [ This server' | ||
| - | Which port do you want to use for the seafile fileserver? | ||
| - | [ default " | ||
| - | |||
| - | ------------------------------------------------------- | ||
| - | Please choose a way to initialize seafile databases: | ||
| - | ------------------------------------------------------- | ||
| - | |||
| - | [1] Create new ccnet/ | ||
| [2] Use existing ccnet/ | [2] Use existing ccnet/ | ||
| - | [ 1 or 2 ] 2 | ||
| - | What is the host of mysql server? | ||
| - | [ default " | ||
| - | |||
| - | What is the port of mysql server? | ||
| - | [ default " | ||
| - | |||
| - | Which mysql user to use for seafile? | ||
| [ mysql user for seafile ] seafile | [ mysql user for seafile ] seafile | ||
| - | What is the password for mysql user " | ||
| - | [ 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 "seafile" | + | < |
| + | echo "export LC_ALL=de_DE.UTF-8" | ||
| + | echo " | ||
| + | echo " | ||
| + | source ~/.bashrc | ||
| + | </ | ||
| + | Configuring the Apache Web Server | ||
| - | Enter the existing database name for seafile: | + | In this step, you will configure |
| - | [ seafile database ] seafile_server | + | |
| - | verifying user " | + | To begin forwarding requests, you will need to enable the proxy_http module in the Apache configuration. This module provides features for proxying HTTP and HTTPS requests. The following command will enable the module: |
| + | < | ||
| + | sudo a2enmod proxy_http | ||
| + | </ | ||
| + | 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 |
| - | [ seahub database ] seahub_server | + | |
| - | verifying user " | + | Open the configuration file in a text editor: |
| + | < | ||
| + | sudo nano / | ||
| + | </ | ||
| + | The lines from ServerAdmin to SSLCertificateKeyFile are part of the initial Apache and Let’s Encrypt configuration that you set up in the prerequisite tutorials. Add the highlighted content, beginning at Alias and ending with the ProxyPassReverse directive: | ||
| + | / | ||
| - | --------------------------------- | + | < |
| - | This is your configuration | + | < |
| - | --------------------------------- | + | < |
| + | ServerAdmin admin@your_email_domain | ||
| + | ServerName your_domain | ||
| + | ServerAlias www.your_domain | ||
| + | DocumentRoot / | ||
| + | ErrorLog ${APACHE_LOG_DIR}/ | ||
| + | CustomLog ${APACHE_LOG_DIR}/ | ||
| - | server name: seafile-server | + | Include / |
| - | | + | SSLCertificateFile |
| + | SSLCertificateKeyFile / | ||
| - | seafile data dir: /srv/seafile-data | + | Alias |
| - | | + | < |
| + | Require all granted | ||
| + | </ | ||
| - | database: | + | # seafile fileserver |
| - | ccnet database: ccnet_server | + | ProxyPass /seafhttp http://127.0.0.1:8082 |
| - | seafile database: seafile_server | + | ProxyPassReverse /seafhttp http:// |
| - | | + | RewriteEngine On |
| - | | + | RewriteRule ^/seafhttp - [QSA,L] |
| + | # seahub web interface | ||
| + | SetEnvIf Authorization " | ||
| + | ProxyPass / http:// | ||
| + | ProxyPassReverse / http:// | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | The Alias directive maps the URL path your_domain/ | ||
| - | --------------------------------- | + | Save and exit the file. |
| - | Press ENTER to continue, or Ctrl-C to abort | + | |
| - | --------------------------------- | + | |
| - | Generating ccnet configuration ... | + | |
| - | Generating seafile | + | 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 configuration. Restart 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 Seahub. Next, 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 / |
| - | Your seafile | + | |
| - | ----------------------------------------------------------------- | + | |
| - | 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 | + | Update / |
| - | ----------------------------------------------------------------- | + | . . . |
| - | If you are behind a firewall, remember to allow input/output of these tcp ports: | + | SERVICE_URL=http:/ |
| - | ----------------------------------------------------------------- | + | . . . |
| - | 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: | + | Update / |
| - | When problems occur, Refer to | + | . . . |
| + | SERVICE_URL = https:// | ||
| + | . . . | ||
| - | https:// | + | 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/ |
| - | 4. Manage Seafile Services on Debian 11 / Debian 10 | + | |
| - | Now we will start the Seafile Server daemon that allows us to upload, download | + | Add a FILE_SERVER_ROOT setting in the file to specify the path where the file server is listening for file uploads |
| + | Update / | ||
| - | $ cd / | + | # -*- coding: utf-8 -*- |
| - | $ sudo ./ | + | SECRET_KEY = "..." |
| - | Starting seafile server, please wait ... | + | FILE_SERVER_ROOT = 'https:// |
| - | ** Message: 03: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 / |
| + | ./ | ||
| + | ./ | ||
| - | $ sudo ./seahub.sh start | + | As this is the first time you have started |
| - | LC_ALL | + | |
| - | Starting seahub at port 8000 ... | + | |
| - | + | ||
| - | ---------------------------------------- | + | |
| - | It' | + | |
| - | ---------------------------------------- | + | |
| + | 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 | + | |
| - | [ 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:// |
| - | echo " | + | Login screen of the Seafile web interface |
| - | echo " | + | |
| - | echo " | + | Once logged in successfully, |
| - | 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 | + | To enable the file server and the web interface to start automatically at boot, you can create their respective |
| - | For the Backend | + | Create a systemd service file for the Seafile file server: |
| + | |||
| + | sudo nano / | ||
| + | |||
| + | Add the following content to the file: | ||
| + | Create / | ||
| - | sudo tee / | ||
| [Unit] | [Unit] | ||
| Description=Seafile | Description=Seafile | ||
| - | After= mysql.service | + | After=network.target |
| - | After=network.target | + | |
| + | < | ||
| [Service] | [Service] | ||
| Type=forking | Type=forking | ||
| - | ExecStart=/srv/ | + | ExecStart=/home/< |
| - | ExecStop=/srv/ | + | ExecStop=/home/< |
| + | User=< | ||
| + | Group=< | ||
| [Install] | [Install] | ||
| WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| - | EOF | + | </ |
| + | 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 |
| + | < | ||
| + | sudo nano / | ||
| + | </ | ||
| + | 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: | ||
| + | < | ||
| + | Create / | ||
| - | sudo tee / | ||
| [Unit] | [Unit] | ||
| - | Description=Seafile | + | Description=Seafile |
| - | After= mysql.service | + | After=network.target |
| - | After=network.target | + | |
| [Service] | [Service] | ||
| Type=forking | Type=forking | ||
| - | ExecStart=/srv/ | + | ExecStart=/home/< |
| - | ExecStop=/srv/ | + | ExecStop=/home/< |
| + | User=< | ||
| + | Group=< | ||
| [Install] | [Install] | ||
| WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| - | EOF | + | </ |
| + | 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: | ||
| + | < | ||
| + | sudo systemctl enable seafile.service | ||
| + | sudo systemctl enable seahub.service | ||
| + | </ | ||
| + | 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/ | ||
| + | |||
| + | 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 / | + | 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 | + | Add a file, for example a document or a photo, into the My Library folder. After some time, the file will upload |
| - | 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:// |
| - | $ systemctl status seafile | + | My Library page to verify file sync |
| - | ● seafile.service - Seafile | + | |
| - | | + | |
| - | | + | |
| - | Process: 13695 ExecStart=/ | + | |
| - | Main PID: 13713 (seafile-control) | + | |
| - | Tasks: 1 (limit: 4663) | + | |
| - | | + | |
| - | CPU: 65ms | + | |
| - | | + | |
| - | | + | |
| - | 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]: | + | |
| - | Dec 08 04:22:10 debian seafile-control[13711]: | + | |
| - | Dec 08 04:22:13 debian seafile.sh[13695]: | + | |
| - | Dec 08 04:22:13 debian seafile.sh[13695]: | + | |
| - | 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 |
| - | ● seahub.service - Seafile | + | |
| - | | + | |
| - | | + | |
| - | Process: 14200 ExecStart=/ | + | |
| - | Main PID: 14213 (python3) | + | |
| - | Tasks: 6 (limit: 4663) | + | |
| - | | + | |
| - | CPU: 503ms | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | 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, |
| - | 5. Configure 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:// |
| - | Install | + | The recommended reverse proxy is Nginx. |
| + | 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/ | + | 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 file, add the contents below. | + | If your setup differs from thes requirements, adjust |
| - | server { | + | The setup proceeds in two steps: First, Apache is installed. Second, a SSL certificate is integrated in the Apache configuration. |
| - | listen 80; | + | Installing Apache¶ |
| - | listen [::]:80; | + | |
| - | server_name | + | |
| - | | + | |
| - | client_max_body_size 100M; | + | |
| - | access_log / | + | |
| - | error_log / | + | |
| - | | + | Install and enable apache modules: |
| - | | + | < |
| - | proxy_set_header | + | sudo a2enmod rewrite |
| - | proxy_set_header | + | sudo a2enmod proxy_http |
| - | proxy_set_header | + | </code> |
| - | proxy_set_header | + | Important: Due to the security advisory published by Django team, we recommend to disable GZip compression to mitigate BREACH attack. No version earlier than Apache 2.4 should be used. |
| - | proxy_read_timeout | + | Configuring Apache¶ |
| - | } | + | |
| - | | + | Modify Apache config file. For CentOS, this is vhost.conf. For Debian/Ubuntu, this is sites-enabled/000-default. |
| - | rewrite ^/seafhttp(.*)$ $1 break; | + | < |
| - | | + | < |
| - | | + | ServerName seafile.example.com |
| - | | + | # Use " |
| - | | + | # Use " |
| - | | + | |
| - | send_timeout | + | Alias / |
| - | } | + | |
| - | | + | |
| - | root / | + | |
| - | } | + | |
| - | } | + | |
| - | Remove the deafult nginx file | + | RewriteEngine On |
| - | sudo mv /etc/nginx/ | + | < |
| + | Require all granted | ||
| + | </Location> | ||
| - | Restart nginx service by running the following commands: | + | # |
| + | # seafile fileserver | ||
| + | # | ||
| + | ProxyPass /seafhttp http:// | ||
| + | ProxyPassReverse /seafhttp http:// | ||
| + | RewriteRule ^/seafhttp - [QSA,L] | ||
| - | sudo systemctl restart nginx | + | # |
| + | # seahub | ||
| + | # | ||
| + | SetEnvIf Authorization " | ||
| + | ProxyPreserveHost On | ||
| + | ProxyPass / http:// | ||
| + | ProxyPassReverse / http:// | ||
| + | </ | ||
| + | </ | ||
| + | Getting a Let's Encrypt certificate¶ | ||
| - | 6. Access 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 | + | First, go to the Certbot website and choose your web server and OS. |
| + | Second, follow | ||
| - | Enter the set admin username | + | We recommend that you get just a certificate |
| + | < | ||
| + | sudo certbot --apache certonly | ||
| + | </ | ||
| + | Follow the instructions on the screen. | ||
| - | Incase you have a problem “Sorry, but the requested page is unavailable due to a server hiccup” Dont worry, just proceed as below. | + | Upon successful verification, Certbot saves the certificate files in a directory named after the host name in / |
| + | Adjusting Apache configuration¶ | ||
| - | sudo systemctl stop seafile | + | To use HTTPS, you need to enable mod_ssl: |
| - | sudo systemctl stop seahub | + | < |
| - | sudo rm -rf /tmp/ | + | sudo a2enmod ssl |
| - | sudo reboot -i | + | </code> |
| + | Then modify your Apache configuration file. Here is a sample: | ||
| + | < | ||
| + | < | ||
| + | ServerName seafile.example.com | ||
| + | DocumentRoot /var/www | ||
| - | Then proceed and access the dashboard on reboot. | + | SSLEngine On |
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| - | 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 / |
| - | 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 | + | < |
| - | 7. Configure Seafile Client | + | |
| + | </ | ||
| - | 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: | ||
| + | ProxyPassReverse /seafhttp http:// | ||
| + | RewriteRule ^/seafhttp - [QSA,L] | ||
| - | sudo wget https://linux-clients.seafile.com/seafile.asc -O /usr/share/ | + | # |
| - | sudo bash -c "echo 'deb [arch=amd64 signed-by=/ | + | # seahub |
| + | # | ||
| + | SetEnvIf Authorization " | ||
| + | ProxyPreserveHost On | ||
| + | ProxyPass / 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: | ||
| + | < | ||
| + | sudo service apache2 restart | ||
| + | </code> | ||
| + | Modifying ccnet.conf¶ | ||
| - | Install | + | The SERVICE_URL in ccnet.conf informs |
| - | sudo apt update | + | SERVICE_URL = https://seafile.example.com |
| - | sudo apt install -y seafile-gui | + | |
| - | The commandline Seafile client | + | Note: TheSERVICE_URL |
| + | 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 = ' |
| - | 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, |
| + | Modifying seafile.conf (optional)¶ | ||
| - | Provide information for the Seafile | + | To improve security, |
| - | On successful authentication, | + | Add the following line in the [fileserver] block on seafile.conf in / |
| + | < | ||
| + | host = 127.0.0.1 | ||
| + | </ | ||
| + | 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: |
| + | < | ||
| + | su seafile | ||
| + | cd / | ||
| + | ./ | ||
| + | ./seahub.sh restart | ||
| + | </ | ||
wiki/seafile.1661003415.txt.gz · Zuletzt geändert: 2022/08/20 16:50 (Externe Bearbeitung)