debian 文件共享_如何在Debian 10上使用Seafile同步和共享文件

debian 文件共享

介绍 (Introduction)

Seafile is an open-source, self-hosted, file synchronization and sharing platform. Users can store and optionally encrypt data on their own servers with storage space as the only limitation. With Seafile you can share files and folders using cross-platform syncing and password-protected links to files with expiration dates. A file-versioning feature means that users can restore deleted and modified files or folders.

Seafile是一个开源,自托管的文件同步和共享平台。 用户可以将存储空间作为唯一限制,在自己的服务器上存储和选择加密数据。 使用Seafile,您可以使用跨平台同步和具有到期日期的文件的受密码保护的链接来共享文件和文件夹。 文件版本控制功能意味着用户可以还原已删除和修改的文件或文件夹。

In this tutorial, you will install and configure Seafile on a Debian 10 server. You will use MariaDB (the default MySQL variant on Debian 10) to store data for the different components of Seafile, and Apache as the proxy server to handle the web traffic. After completing this tutorial, you will be able use the web interface to access Seafile from desktop or mobile clients, allowing you to sync and share your files with other users or groups on the server or with the public.

在本教程中,您将在Debian 10服务器上安装和配置Seafile。 您将使用MariaDB(Debian 10的默认MySQL变体)存储Seafile不同组件的数据,并使用Apache作为代理服务器来处理Web流量。 完成本教程后,您将能够使用Web界面从台式机或移动客户端访问Seafile,从而使您可以与服务器上的其他用户或组或公众同步并共享文件。

先决条件 (Prerequisites)

Before you begin this guide, you’ll need the following:

在开始本指南之前,您需要满足以下条件:

第1步-为Seafile组件创建数据库 (Step 1 — Creating Databases for the Seafile Components)

Seafile requires three components in order to work properly:

Seafile需要三个组件才能正常工作:

  • Seahub: Seafile’s web frontend, written in Python using the Django web framework. From Seahub you can access, manage, and share your files using a web browser.

    Seahub :Seafile的Web前端,使用Django Web框架以Python编写。 从Seahub,您可以使用Web浏览器访问,管理和共享文件。

  • Seafile server: The data service daemon that manages the raw file upload, download, and synchronization. You do not interact with the server directly, but instead use a client program or the Seahub web interface.

    Seafile服务器 :数据服务守护程序,用于管理原始文件的上载,下载和同步。 您不直接与服务器交互,而是使用客户端程序或Seahub Web界面。

  • Ccnet server: The RPC service daemon to enable internal communication between the different components of Seafile. For example, when you use Seahub, it is able to access data from the Seafile server using the Ccnet RPC service.

    Ccnet服务器 :RPC服务守护程序,用于启用Seafile的不同组件之间的内部通信。 例如,当您使用Seahub时,它便可以使用Ccnet RPC服务从Seafile服务器访问数据。

Each of these components stores its data separately in its own database. In this step you will create the three MariaDB databases and a user before proceeding to set up the server.

这些组件中的每一个都将其数据分别存储在其自己的数据库中。 在此步骤中,您将创建三个MariaDB数据库和一个用户,然后继续设置服务器。

First, log in to the server using SSH with your username and IP address:

首先,使用您的用户名和IP地址使用SSH登录服务器:

ssh sammy@your_server_ip

Connect to the MariaDB database server as administrator (root):

以管理员(根)身份连接到MariaDB数据库服务器:

  • sudo mysql

    须藤MySQL

At the MariaDB prompt, use the following SQL command to create the database user:

在MariaDB提示符下,使用以下SQL命令创建数据库用户:

  • CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';

    创建用户' sammy '@'localhost'由' password '标识;

Next, you will create the following databases to store the data of the three Seafile components:

接下来,您将创建以下数据库来存储三个Seafile组件的数据:

  • ccnet-db for the Ccnet server.

    ccnet-db用于Ccnet服务器。

  • seahub-db for the Seahub web frontend.

    seahub-db用于Seahub Web前端。

  • seafile-db for the Seafile file server.

    seafile-db用于Seafile文件服务器。

At the MariaDB prompt, create your databases:

在MariaDB提示符下,创建数据库:

  • CREATE DATABASE 'ccnet-db' CHARACTER SET = 'utf8';

    CREATE DATABASE'ccnet -db'CHARACTER SET ='utf8';

  • CREATE DATABASE 'seafile-db' CHARACTER SET = 'utf8';

    CREATE DATABASE'seafile -db'CHARACTER SET ='utf8';

  • CREATE DATABASE 'seahub-db' CHARACTER SET = 'utf8';

    CREATE DATABASE'seahub -db'CHARACTER SET ='utf8';

Then, grant all privileges to your database user to access and make changes in these databases:

然后,向您的数据库用户授予所有特权,以访问和更改这些数据库:

  • GRANT ALL PRIVILEGES ON 'ccnet-db'.* to 'sammy'@localhost;

    将所有特权授予 ' ccnet-db '。*到' sammy '@localhost;

  • GRANT ALL PRIVILEGES ON 'seafile-db'.* to 'sammy'@localhost;

    将所有特权授予 ' seafile-db '。*到' sammy '@localhost;

  • GRANT ALL PRIVILEGES ON 'seahub-db'.* to 'sammy'@localhost;

    将所有权限授予 ' seahub-db '。*到' sammy '@localhost;

Exit the MariaDB prompt by typing exit:

通过键入exit退出MariaDB提示符:

  • exit

    出口

Now that you have created a user and the databases required to store the data for each of the Seafile components, you will install dependencies to download the Seafile server package.

现在,您已经创建了一个用户和存储每个Seafile组件数据所需的数据库,您将安装依赖项以下载Seafile服务器软件包。

第2步-安装依赖项并下载Seafile (Step 2 — Installing Dependencies and Downloading Seafile)

Some parts of Seafile are written in Python and therefore require additional Python modules and programs to work. In this step, you will install these required dependencies before downloading and extracting the Seafile server package.

Seafile的某些部分是用Python编写的,因此需要其他Python模块和程序才能工作。 在此步骤中,您将在下载和提取Seafile服务器软件包之前安装这些必需的依赖项。

To install the dependencies using apt run the following command:

要使用apt安装依赖项,请运行以下命令:

  • sudo apt install python-setuptools python-pip python-urllib3 python-requests python-mysqldb ffmpeg

    sudo apt安装python-setuptools python-pip python-urllib3 python-requests python-mysqldb ffmpeg

The python-setuptools and python-pip dependencies oversee installing and managing Python packages. The python-urllib3 and python-requests packages make requests to websites. Finally, the python-mysqldb is a library for using MariaDB from Python and ffmpeg handles multimedia files.

python-setuptoolspython-pip依赖项监督安装和管理Python软件包。 python-urllib3python-requests软件包向网站发出请求。 最后, python-mysqldb是一个使用Python中的MariaDB的库,而ffmpeg处理多媒体文件。

Seafile requires Pillow, a python library for image processing, and moviepy to handle movie file thumbnails. These modules are not available in the Debian package repository, so instead install them with pip:

Seafile需要Pillow (一个用于图像处理的python库)和moviepy来处理电影文件缩略图。 这些模块在Debian软件包存储库中不可用,因此请使用pip安装它们:

  • sudo pip install Pillow moviepy

    sudo pip install Pillow moviepy

Now that you have installed the necessary dependencies, you can download the Seafile server package.

既然您已经安装了必要的依赖项,就可以下载Seafile服务器软件包。

Seafile creates additional directories during setup. To keep them all organized, create a new directory and change into it:

Seafile在安装过程中会创建其他目录。 为了使它们井井有条,请创建一个新目录并将其更改为:

  • mkdir seafile

    mkdir seafile
  • cd seafile

    cd海文件

You can now download the latest version (7.0.4 as of this writing) of the Seafile server from the project website by running the following command:

您现在可以通过运行以下命令从项目网站下载Seafile服务器的最新版本(截至撰写本文时为7.0.4 ):

  • wget https://download.seadrive.org/seafile-server_7.0.4_x86-64.tar.gz

    wget https://download.seadrive.org/seafile-server_ 7.0.4 _x86-64.tar.gz

Seafile distributes the download as a compressed tar archive, which means you will need to extract it before proceeding. Extract the archive using tar:

Seafile将下载内容作为压缩的tar存档分发,这意味着您需要先提取它,然后才能继续。 使用tar提取档案:

  • tar -zxvf seafile-server_7.0.4_x86-64.tar.gz

    tar -zxvf seafile-server_ 7.0.4 _x86-64.tar.gz

Now change into the extracted directory:

现在转到提取的目录:

  • cd seafile-server-7.0.4

    cd seafile-server- 7.0.4

At this stage, you have downloaded and extracted the Seafile server package and have also installed the necessary dependencies. You are now ready to configure the Seafile server.

在此阶段,您已经下载并提取了Seafile服务器软件包,还安装了必要的依赖项。 现在您可以配置Seafile服务器了。

步骤3 —配置Seafile服务器 (Step 3 — Configuring the Seafile Server)

Seafile needs some information about your setup before you start the services for the first time. This includes details like the domain name, the database configuration, and the path where it will store data. To initiate the series of question prompts to provide this information, you can run the script setup_seafile_mysql.sh, which is included in the archive you extracted in the previous step.

首次启动服务之前,Seafile需要有关您的设置的一些信息。 这包括诸如域名,数据库配置以及它将存储数据的路径之类的详细信息。 要启动一系列提示提示以提供此信息,可以运行脚本setup_seafile_mysql.sh ,该脚本包含在上一步中提取的归档文件中。

Run the script using bash:

使用bash运行脚本:

  • bash setup-seafile-mysql.sh

    bash安装程序seafile-mysql.sh

Press ENTER to continue when prompted.

出现提示时,按ENTER继续。

The script will now prompt you with a series of questions. Wherever defaults are mentioned, pressing the ENTER key will use that value.

现在,脚本将提示您一系列问题。 凡提及默认值的地方,按ENTER键将使用该值。

This tutorial uses Seafile as the server name, but you can change it if you’d like:

本教程使用Seafile作为服务器名称,但是您可以根据需要更改它:

Question 1

What is the name of the server?
It will be displayed on the client. 3 - 15 letters or digits
[ server name ] Seafile

For Question 2, enter the domain name for this Seafile instance.

对于Question 2 ,输入此Seafile实例的域名。

Question 2

What is the ip or domain of the server?.
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] your_domain

Press ENTER to accept the default value for Question 3. If you have set up external storage, for example, using NFS or block storage, you will need to specify the path to that location here instead.

ENTER接受Question 3的默认值。 如果您设置了外部存储(例如,使用NFS或块存储),则需要在此处指定该位置的路径。

Question 3

Where do you want to put your seafile data?
Please use a volume with enough free space
[ default "/home/sammy/seafile/seafile-data" ]

For Question 4 press ENTER to accept the default port number.

对于Question 4ENTER接受默认端口号。

Question 4

Which port do you want to use for the seafile fileserver?
[ default "8082" ]

The next prompt allows you to confirm the database configuration. You can create new databases or use existing databases for setup. For this tutorial you have created the necessary databases in Step 1, so select option 2 here.

下一个提示符允许您确认数据库配置。 您可以创建新数据库或使用现有数据库进行设置。 对于本教程,您已经在步骤1中创建了必要的数据库,因此请在此处选择选项2

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases

[ 1 or 2 ] 2

Questions 6–9 relate to the MariaDB database server. You need to provide the username and password of the MySQL user that you created in Step 1, but you can press ENTER to accept the default values for host and port.

问题6–9与MariaDB数据库服务器有关。 您需要提供在步骤1中创建MySQL用户的用户名和密码,但是您可以按ENTER接受hostport的默认值。

What is the host of mysql server?

[ default "localhost" ]

What is the port of mysql server?

[ default "3306" ]

Which mysql user to use for seafile?

[ mysql user for seafile ] sammy

What is the password for mysql user "seafile"?

[ password for seafile ] password

After providing the password, the script will request the names of the Seafile databases. Use ccnet-db, seafile-db, and seahub-db for this tutorial. The script will then verify if there is a successful connection to the databases before proceeding to display a summary of the initial configuration.

提供密码后,脚本将请求Seafile数据库的名称。 在本教程中使用ccnet-dbseafile-dbseahub-db 。 然后,脚本将在继续显示初始配置摘要之前,验证与数据库的连接是否成功。

Enter the existing database name for ccnet:
[ ccnet database ] ccnet-db

verifying user "sammy" access to database ccnet-db ...  done

Enter the existing database name for seafile:
[ seafile database ] seafile-db

verifying user "sammy" access to database seafile-db ...  done

Enter the existing database name for seahub:
[ seahub database ] seahub-db

verifying user "sammyFor this tutorial you have" access to database seahub-db ...  done

---------------------------------
This is your configuration
---------------------------------

    server name:            Seafile
    server ip/domain:       your_domain

    seafile data dir:       /home/sammy/seafile/seafile-data
    fileserver port:        8082

    database:               use existing
    ccnet database:         ccnet-db
    seafile database:       seafile-db
    seahub database:        seahub-db
    database user:          sammy

--------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------

Press ENTER to confirm.

ENTER确认。


   
   
Output
Generating ccnet configuration ... done Successly create configuration dir /home/sammy/seafile/ccnet. Generating seafile configuration ... done Generating seahub configuration ... ---------------------------------------- Now creating seahub database tables ... ---------------------------------------- creating seafile-server-latest symbolic link ... done ----------------------------------------------------------------- Your seafile server configuration has been finished successfully. ----------------------------------------------------------------- run seafile server: ./seafile.sh { start | stop | restart } run seahub server: ./seahub.sh { start <port> | stop | restart <port> } ----------------------------------------------------------------- If you are behind a firewall, remember to allow input/output of these tcp ports: ----------------------------------------------------------------- port of seafile fileserver: 8082 port of seahub: 8000 When problems occur, Refer to https://github.com/haiwen/seafile/wiki for information.

You will be running Seafile behind Apache, which you’ve already allowed through your server’s firewall. Hence, you don’t need to worry about opening ports 8082 and 8000 as well and you can ignore that part of the output.

您将在Apache后面运行Seafile,已经通过服务器防火墙允许了它。 因此,您不必担心打开端口80828000 ,也可以忽略输出的那部分。

You have completed the initial configuration of the server. In the next step, you will configure the Apache web server before starting the Seafile services.

您已完成服务器的初始配置。 在下一步中,您将在启动Seafile服务之前配置Apache Web服务器。

第4步-配置Apache Web服务器 (Step 4 — Configuring the Apache Web Server)

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.

在此步骤中,您将配置Apache Web服务器以将所有请求转发到Seafile。 以这种方式使用Apache允许您使用不带端口号的URL,启用与Seafile的HTTPS连接,并利用Apache提供的缓存功能以获得更好的性能。

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:

要开始转发请求,您将需要在Apache配置中启用proxy_http模块。 该模块提供用于代理HTTP和HTTPS请求的功能。 以下命令将启用该模块:

  • sudo a2enmod proxy_http

    须藤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.

注意:此设置还需要Apache rewritessl模块。 在先决条件部分中列出的第二个Apache教程中,已经配置了这些模块作为配置“让我们加密”的一部分。

Next, update the virtual host configuration of your_domain to forward requests to the Seafile file server and to the Seahub web interface.

接下来,更新your_domain的虚拟主机配置,以将请求转发到Seafile文件服务器和Seahub Web界面。

Open the configuration file in a text editor:

在文本编辑器中打开配置文件:

  • sudo nano /etc/apache2/sites-enabled/your_domain-le-ssl.conf

    须藤纳米/ etc / apache2 / sites-enabled / your_domain -le-ssl.conf

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:

ServerAdminSSLCertificateKeyFile的行是在先决条件教程中设置的初始Apache和Let's Encrypt配置的一部分。 添加突出显示的内容,从Alias开始,以ProxyPassReverse指令结束:

/etc/apache2/sites-enabled/your_domain-le-ssl.conf
/etc/apache2/sites-enabled/your_domain-le-ssl.conf
<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

    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/your_domain/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/your_domain/privkey.pem

    Alias /media  /home/sammy/seafile/seafile-server-latest/seahub/media
    <Location /media>
        Require all granted
    </Location>

    # seafile fileserver
    ProxyPass /seafhttp http://127.0.0.1:8082
    ProxyPassReverse /seafhttp http://127.0.0.1:8082
    RewriteEngine On
    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>

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]).

Alias指令将URL路径your_domain /media映射到Seafile使用的文件系统中的本地路径。 使用以下Location指令可以访问此目录中的内容。 ProxyPassProxyPassReverse指令使Apache充当此主机的反向代理, /seafhttp //seafhttp请求转发到分别在本地主机端口80008082上运行的Seafile Web界面和文件服务器。 RewriteRule指令将所有请求保持不变地传递到/seafhttp并停止处理其他规则( [QSA,L] )。

Save and exit the file.

保存并退出文件。

Test if there are any syntax errors in the virtual host configuration:

测试虚拟主机配置中是否存在任何语法错误:

  • sudo apache2ctl configtest

    须藤apache2ctl configtest

If it reports Syntax OK, then there are no issues with your configuration. Restart Apache for the changes to take effect:

如果它报告Syntax OK ,则您的配置没有问题。 重新启动Apache以使更改生效:

  • sudo systemctl restart apache2

    sudo systemctl重新启动apache2

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.

现在,您已将Apache配置为充当Seafile文件服务器和Seahub的反向代理。 接下来,您将在启动服务之前更新Seafile配置中的URL。

步骤5 —更新Seafile的配置并启动服务 (Step 5 — Updating Seafile’s Configuration and Starting Services)

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.

由于现在使用Apache将所有请求代理到Seafile,因此在启动Seafile服务之前,需要使用文本编辑器更新conf目录中Seafile配置文件中的URL。

Open ccnet.conf in a text editor:

在文本编辑器中打开ccnet.conf

  • nano /home/sammy/seafile/conf/ccnet.conf

    纳米/ home / sammy /seafile/conf/ccnet.conf

Near the top of the file, within the [General] block, is the SERVICE_URL directive. It will look like this:

[General]块中,文件顶部附近是SERVICE_URL指令。 它看起来像这样:

Update /home/sammy/seafile/conf/ccnet.conf
更新/home/sammy/seafile/conf/ccnet.conf
. . .
SERVICE_URL=http://www.example.com:8000
. . .

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:

修改此设置以指向您的域。 确保您提供的URL使用HTTPS协议,并且不包含任何端口号:

Update /home/sammy/seafile/conf/ccnet.conf
更新/home/sammy/seafile/conf/ccnet.conf
. . .
SERVICE_URL = https://your_domain
. . .

Save and exit the file once you have added the content.

添加内容后,保存并退出文件。

Now open seahub_settings.py in a text editor:

现在,在文本编辑器中打开seahub_settings.py

  • nano /home/sammy/seafile/conf/seahub_settings.py

    纳米/ home / sammy /seafile/conf/seahub_settings.py

Add a FILE_SERVER_ROOT setting in the file to specify the path where the file server is listening for file uploads and downloads:

在文件中添加FILE_SERVER_ROOT设置,以指定文件服务器侦听文件上载和下载的路径:

Update /home/sammy/seafile/conf/seahub_settings.py
更新/home/sammy/seafile/conf/seahub_settings.py
# -*- coding: utf-8 -*-
SECRET_KEY = "..."
FILE_SERVER_ROOT = 'https://your_domain/seafhttp'
# ...

Save and exit seahub_settings.py.

保存并退出seahub_settings.py

Now you can start the Seafile service and the Seahub interface:

现在,您可以启动Seafile服务和Seahub界面:

  • cd /home/sammy/seafile/seafile-server-7.0.4

    cd / home / sammy / seafile / seafile-server- 7.0.4

  • ./seafile.sh start

    ./seafile.sh开始
  • ./seahub.sh start

    ./seahub.sh开始

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:

由于这是您第一次启动Seahub服务,它将提示您创建一个管理员帐户。 输入此管理员用户的有效电子邮件地址和密码:


   
   
Output
What is the email for the admin account? [ admin email ] admin@your_email_domain What is the password for the admin account? [ admin password ] password-here Enter the password again: [ admin password again ] password-here ---------------------------------------- Successfully created seafile admin ---------------------------------------- Seahub is started Done.

Open https://your_domain in a web browser and log in using your Seafile admin email address and password.

在网络浏览器中打开https:// your_domain ,然后使用Seafile管理员电子邮件地址和密码登录。

Once logged in successfully, you can access the admin interface or create new users.

成功登录后,您可以访问管理界面或创建新用户。

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.

现在,您已经验证了Web界面是否正常工作,接下来可以在系统启动时启用这些服务。

步骤6 —使Seafile服务器在系统引导时启动 (Step 6 — Enabling the Seafile Server to Start at System Boot)

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.

要使文件服务器和Web界面在启动时自动启动,您可以创建它们各自的systemd服务文件并激活它们。

Create a systemd service file for the Seafile file server:

为Seafile文件服务器创建一个systemd服务文件:

  • sudo nano /etc/systemd/system/seafile.service

    须藤nano /etc/systemd/system/seafile.service

Add the following content to the file:

将以下内容添加到文件中:

Create /etc/systemd/system/seafile.service
创建/etc/systemd/system/seafile.service
[Unit]
Description=Seafile
After=network.target mysql.service

[Service]
Type=forking
ExecStart=/home/sammy/seafile/seafile-server-latest/seafile.sh start
ExecStop=/home/sammy/seafile/seafile-server-latest/seafile.sh stop
User=sammy
Group=sammy

[Install]
WantedBy=multi-user.target

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.

在这里, ExectStartExecStop行指示运行以启动和停止Seafile服务的命令。 该服务将以sammy作为UserGroupAfter行指定网络和MariaDB服务启动后,Seafile服务将启动。

Save seafile.service and exit.

保存seafile.service并退出。

Create a systemd service file for the Seahub web interface:

为Seahub Web界面创建一个systemd服务文件:

  • sudo nano /etc/systemd/system/seahub.service

    须藤纳米/etc/systemd/system/seahub.service

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:

这类似于Seafile服务。 唯一的区别是Web界面是在Seafile服务之后启动的。 将以下内容添加到该文件:

Create /etc/systemd/system/seahub.service
创建/etc/systemd/system/seahub.service
[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]
Type=forking
ExecStart=/home/sammy/seafile/seafile-server-latest/seahub.sh start
ExecStop=/home/sammy/seafile/seafile-server-latest/seahub.sh stop
User=sammy
Group=sammy

[Install]
WantedBy=multi-user.target

Save seahub.service and exit.

保存seahub.service并退出。

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:

最后,要使Seafile和Seahub服务在启动时自动启动,请运行以下命令:

  • sudo systemctl enable seafile.service

    sudo systemctl启用seafile.service
  • sudo systemctl enable seahub.service

    sudo systemctl启用seahub.service

When the server is rebooted, Seafile will start automatically.

重新启动服务器后,Seafile将自动启动。

At this point, you have completed setting up the server, and can now test each of the services.

至此,您已经完成服务器的设置,现在可以测试每个服务了。

第7步-测试文件同步和共享功能 (Step 7 — 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.

在此步骤中,您将测试已设置服务器的文件同步和共享功能,并确保它们正常运行。 为此,您需要在单独的计算机和/或移动设备上安装Seafile客户端程序。

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.

访问Seafile网站上的下载页面,并按照说明在计算机上安装最新版本的客户端程序。 Seafile客户端可用于Linux(Ubuntu,Debian,Fedora,Centos / RHEL,Arch Linux),MacOS和Windows的各种发行版。 移动客户端可从相应的应用商店中用于Android和iPhone / iPad设备。

Once you have installed the Seafile client, you can test the file synchronization and sharing functionality.

一旦安装了Seafile客户端,就可以测试文件同步和共享功能。

Open the Seafile client program on your computer or device. Accept the default location for the Seafile folder and click Next.

在您的计算机或设备上打开Seafile客户端程序。 接受Seafile文件夹的默认位置,然后单击Next

In the next window, enter the server address, username, and password, then click Login.

在下一个窗口中,输入服务器地址,用户名和密码,然后单击登录

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.

在主页上,右键单击“ 我的媒体库” ,然后单击“ 同步此库” 。 接受计算机或设备上位置的默认值。

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.

将文件(例如文档或照片)添加到“ 我的媒体库”文件夹中。 一段时间后,文件将上传到服务器。 以下屏幕快照显示了复制到“ 我的 媒体 库”文件夹中的文件photo.jpg

Now, log in to the web interface at https://your_domain and verify that your file is present on the server.

现在,通过https:// your_domain登录到Web界面,并验证服务器上是否存在您的文件。

Click on Share next to the file to generate a download link for this file that you can share.

单击文件旁边的共享 ,以生成可共享的文件下载链接。

You have verified that the file synchronization is working correctly and that you can use Seafile to sync and share files and folders from multiple devices.

您已验证文件同步工作正常,并且可以使用Seafile同步和共享来自多个设备的文件和文件夹。

结论 (Conclusion)

In this tutorial you set up a private instance of a Seafile server. Now you can start using the server to synchronize files, add users and groups, and share files between them or with the public without relying on an external service.

在本教程中,您将设置Seafile服务器的私有实例。 现在,您可以开始使用服务器来同步文件,添加用户和组,以及在它们之间或与公众共享文件,而无需依赖外部服务。

When a new release of the server is available, please consult the upgrade section of the manual for steps to perform an upgrade.

当有新版本的服务器可用时,请查阅手册的升级部分以获取执行升级的步骤。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-sync-and-share-your-files-with-seafile-on-debian-10

debian 文件共享

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值