本页内容

  • 先决条件
  • 配置防火墙
  • 安装 Git
  • 安装 MariaDB
  • 为 Ampache 配置 MariaDB
  • 安装 PHP 安装 PHP 扩展 配置 PHP-FPM
  • 安装 Nginx
  • 配置 Nginx
  • 使用 Let's Encrypt 设置 HTTPS
  • 安装 Ampache
  • 使用 Ampache 安装程序
  • 添加音乐
  • 结语
  • 安装 PHP 扩展
  • 配置 PHP-FPM

Ampache 是一款用 PHP 编写的开源、基于 Web 的个人音频流媒体应用程序。它可以让你在服务器上托管和管理你的数字音乐收藏,并将其流式传输到你的计算机、智能手机、平板电脑或智能电视。你可以使用各种 Android 和 iOS 应用程序,将音乐从你的 Ampache 音乐服务器流式传输到你的个人设备。

本教程将介绍如何在基于 Fedora 33 的服务器上安装 Ampache 应用程序,以及如何向其中上传音乐以进行流式播放。

先决条件

  • 一台运行 Fedora 33 的服务器。
  • 一个具有 sudo 权限的非 root 用户。
  • 确保所有内容都已更新。$ sudo dnf upgrade
  • 系统所需的一些软件包。$ sudo dnf install wget curl nano zip -y
  • 禁用 SELinux。$ sudo setenforce 0

一台运行 Fedora 33 的服务器。

一个具有 sudo 权限的非 root 用户。

确保所有内容都已更新。

$ sudo dnf upgrade

系统所需的一些软件包。

$ sudo dnf install wget curl nano zip -y

禁用 SELinux。

$ sudo setenforce 0

配置防火墙

第一步是配置防火墙。Fedora 服务器预装了 Firewalld。

检查防火墙是否正在运行。

$ sudo firewall-cmd --state

你应该会看到以下输出。

running

将防火墙的默认区域设置为 public。

$ sudo firewall-cmd --set-default-zone=public

查看当前允许的服务/端口。

$ sudo firewall-cmd --zone=public --permanent --list-services

它应该显示以下输出。

dhcpv6-client mdns ssh

允许 HTTP 和 HTTPS 端口。

$ sudo firewall-cmd --zone=public --permanent --add-service=http
$ sudo firewall-cmd --zone=public --permanent --add-service=https

再次检查防火墙的状态。

$ sudo firewall-cmd --zone=public --permanent --list-services

你应该会看到类似的输出。

dhcpv6-client http https mdns ssh

重新加载防火墙。

$ sudo systemctl reload firewalld

安装 Git

在继续之前,我们需要安装 Git。

$ sudo dnf install git

接下来,使用你的个人信息配置 Git。

$ git config --global user.name "Your Name"
$ git config --global user.email "
[email protected]
"

安装 MariaDB

MariaDB 是 MySQL 的直接替代品,这意味着运行和操作 MariaDB 的命令与 MySQL 的命令相同。

Fedora 33 默认自带 MariaDB 10.4,但由于 MariaDB 10.5 是最新的稳定版本,我们将为此使用官方的 MariaDB 仓库。

创建文件 /etc/yum.repos.d/MariaDB.repo 并打开进行编辑。

$ sudo nano /etc/yum.repos.d/MariaDB.repo

将以下代码粘贴到其中。

# MariaDB 10.5 Fedora repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/fedora33-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

按 Ctrl + X 并在提示时输入 Y 来保存并关闭文件。

要安装 MariaDB,请执行以下命令。

$ sudo dnf install MariaDB-server -y

确保在上面的命令中输入 MariaDB-server 而不是 mariadb-server,因为前者会从官方仓库安装它,而后者命令会从 Fedora 的仓库安装较旧的版本。

检查 MariaDB 是否已正确安装。

$ mysql --version

你应该会看到以下输出。

mysql  Ver 15.1 Distrib 10.5.9-MariaDB, for Linux (x86_64) using  EditLine wrapper

启用并启动 MariaDB 服务。

$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb

运行以下命令执行默认配置,例如设置 root 密码、删除匿名用户、禁止 root 远程登录以及删除测试表。

$ sudo mysql_secure_installation

在 MariaDB 10.4 中,现在会询问你是使用 root 密码还是 unix_socket 插件。该插件允许你使用 Linux 用户凭据登录 MariaDB。它被认为更安全,不过要使用 phpMyAdmin 之类的第三方应用程序,你需要传统的用户名/密码。本教程中我们将坚持使用该插件。你仍然可以通过你为数据库创建的任何指定用户来使用 phpMyAdmin。

按 Enter 键会选择默认选项(即大写的那个,本例中为 Y)。

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): [PRESS ENTER]
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] [PRESS ENTER]
Enabled successfully!
Reloading privilege tables..
 ... Success!

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] [ANSWER n]
... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] [PRESS ENTER]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] [PRESS ENTER]
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] [PRESS ENTER]
 \- Dropping test database...
 ... Success!
 \- Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] [PRESS ENTER]
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

就是这样。下次你想登录 MySQL 时,请使用以下命令

$ sudo mysql

在提示时输入你的 root 密码。

为 Ampache 配置 MariaDB

现在我们需要设置一个供 Ampache 应用程序使用的数据库。为此,请登录 MySQL 提示符。

$ sudo mysql

进入提示符后,输入以下命令,这些命令将创建一个名为 ampache 的数据库和一个名为 ampuser 的数据库用户,并授予其访问该数据库的权限。

mysql> CREATE DATABASE ampache;
mysql> CREATE USER 'ampuser'@'localhost' IDENTIFIED BY 'yourpassword';
mysql> GRANT ALL PRIVILEGES ON ampache.* TO 'ampuser'@'localhost';
mysql> exit

安装 PHP

Fedora 33 默认自带 PHP 7.4,但为了获得更新的 PHP 仓库,我们将添加 REMI 仓库。

安装 REMI 仓库,这是用于安装 PHP 软件包的官方 Fedora 仓库。

$ sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-33.rpm

以模块形式安装 PHP 7.4。

$ sudo dnf module install php:remi-7.4

检查 PHP 是否正常工作。

$ php --version

你应该会看到类似的输出。

PHP 7.4.16 (cli) (built: Mar  2 2021 10:35:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

安装 PHP 扩展

Ampache 需要一些 PHP 扩展。使用以下命令来安装它们。

sudo dnf install php-curl php-gd php-intl php-mysql

配置 PHP-FPM

打开文件 /etc/php-fpm.d/www.conf 。

$ sudo nano /etc/php-fpm.d/www.conf

我们需要将 PHP 进程的 Unix 用户/组设置为 nginx 。在文件中找到 user=apache 和 group=apache 这两行,并将它们改为 nginx。

...
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
...

按 Ctrl + X 并在提示时输入 Y 来保存文件。

接下来,我们需要在 /etc/php.ini 文件中增大音乐上传的文件大小限制。打开该文件进行编辑。

$ sudo nano /etc/php.ini

将以下行

. . .
post_max_size = 8M
. . .
upload_max_filesize = 2M

改为

. . .
post_max_size = 110M
. . .
upload_max_filesize = 100M
. . .

现在,你可以上传最大 100MB 的文件。你可以将该值更改为你想要的任何值。只需确保 post_max_size 大于 upload_max_filesize 变量即可。

按 Ctrl + X 并在提示时输入 Y 来保存文件。

重启 PHP-fpm 进程。

$ sudo systemctl restart php-fpm

安装 Nginx

Fedora 33 默认自带 Nginx 的最新稳定版本(1.18.0)。

安装 Nginx。

$ sudo dnf install nginx -y

检查它是否正常工作。

$ nginx -v

根据你选择安装的 Nginx 版本,你应该会看到以下输出。

nginx version: nginx/1.18.0

启动并启用 Nginx。

$ sudo systemctl start nginx
$ sudo systemctl enable nginx

在浏览器中打开你服务器的 IP 地址,会看到以下页面。这意味着 Nginx 工作正常。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

配置 Nginx

设置用于存放 server 块的目录。

$ sudo mkdir /etc/nginx/sites-available
$ sudo mkdir /etc/nginx/sites-enabled

打开 /etc/nginx/nginx.conf 文件进行编辑。

$ sudo nano /etc/nginx/nginx.conf	

在 include /etc/nginx/conf.d/*.conf 这一行之后粘贴以下行

include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;

按 Ctrl + X 关闭编辑器,并在提示时按 Y 保存文件。

运行以下命令为 Ampache 添加配置文件。

$ sudo nano /etc/nginx/sites-available/ampache.conf

将以下代码粘贴到编辑器中。

server {

    # listen to
    listen  [::]:80;
    listen       80;

    server_name ampache.example.com;
    charset utf-8;

    # Logging, error_log mode [notice] is necessary for rewrite_log on,
    # (very usefull if rewrite rules do not work as expected)

    error_log       /var/log/nginx/ampache.error.log; # notice;
    access_log      /var/log/nginx/ampache.access.log;
    # rewrite_log     on;

    # Use secure headers to avoid XSS and many other things
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header Referrer-Policy "no-referrer";
    add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; object-src 'self'";

    # Avoid information leak
    server_tokens off;
    fastcgi_hide_header X-Powered-By;

    root /var/www/html/ampache;
    index index.php;
    client_max_body_size 100m;

    # Somebody said this helps, in my setup it doesn't prevent temporary saving in files
    proxy_max_temp_file_size 0;

    # Rewrite rule for Subsonic backend
    if ( !-d $request_filename ) {
        rewrite ^/rest/(.*).view$ /rest/index.php?action=$1 last;
        rewrite ^/rest/fake/(.+)$ /play/$1 last;
    }

    # Rewrite rule for Channels
    if (!-d $request_filename){
      rewrite ^/channel/([0-9]+)/(.*)$ /channel/index.php?channel=$1&target=$2 last;
    }

    # Beautiful URL Rewriting
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&name=$6 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&player=$6&name=$7 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&bitrate=$6player=$7&name=$8 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/transcode_to/(w+)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&transcode_to=$6&bitrate=$7&player=$8&name=$9 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&player=$7&name=$8 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&bitrate=$7player=$8&name=$9 last;
    rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/transcode_to/(w+)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&transcode_to=$7&bitrate=$8&player=$9&name=$10 last;

    # the following line was needed for me to get downloads of single songs to work
    rewrite ^/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/action/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4action=$5&name=$6 last;
    location /play {
        if (!-e $request_filename) {
			rewrite ^/play/art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /image.php?object_type=$2&object_id=$3&auth=$1 last;
        }

		rewrite ^/([^/]+)/([^/]+)(/.*)?$ /play/$3?$1=$2;
		rewrite ^/(/[^/]+|[^/]+/|/?)$ /play/index.php last;
		break;
    }

   location /rest {
      limit_except GET POST {
         deny all;
      }
   }

   location ^~ /bin/ {
      deny all;
      return 403;
   }

   location ^~ /config/ {
      deny all;
      return 403;
   }

   location / {
      limit_except GET POST HEAD{
         deny all;
      }
   }

   location ~ ^/.*.php {
        fastcgi_index index.php;

        # sets the timeout for requests in [s] , 60s are normally enough
        fastcgi_read_timeout 600s;

        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        # Mitigate HTTPOXY https://httpoxy.org/
        fastcgi_param HTTP_PROXY "";

        # has to be set to on if encryption (https) is used:
        fastcgi_param HTTPS on;

        fastcgi_split_path_info ^(.+?\.php)(/.*)$;

        # chose as your php-fpm is configured to listen on
        fastcgi_pass unix:/run/php-fpm/www.sock;
   }

   # Rewrite rule for WebSocket
   location /ws {
        rewrite ^/ws/(.*) /$1 break;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8100/;
   }
}

该文件假设我们将把 Ampache 安装到域名 ampache.example.com 以及目录 /var/www/html/ampache 中。按 Ctrl + X 关闭编辑器,并在提示时按 Y 保存文件。

通过将其链接到 sites-enabled 目录来激活此配置文件。

$ sudo ln -s /etc/nginx/sites-available/ampache.conf /etc/nginx/sites-enabled/

测试 Nginx 配置。

$ sudo nginx -t

你应该会看到以下输出,表明你的配置是正确的。

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

重新加载 Nginx 服务。

$ sudo systemctl reload nginx

使用 Let's Encrypt 设置 HTTPS

要使用 Let's Encrypt,我们需要安装 Certbot 软件包。

安装 Certbot。

$ sudo dnf install certbot certbot-nginx -y

安装证书。

$ sudo certbot --nginx -d ampache.example.com

如果这是你首次在此服务器上使用该工具,你需要同意条款并输入你的电子邮件地址。当被询问是否愿意与 EFF 基金会共享你的电子邮件时,请选择“否”。

如果成功,certbot 将询问你希望如何配置 HTTPS 设置。

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

选择 2 然后按 ENTER 。你的证书现在已安装并激活。

运行以下命令以设置自动续期。

$ echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew" | sudo tee -a /etc/crontab > /dev/null

安装 Ampache

为 Ampache 创建一个空的文档根目录文件夹。

$ sudo mkdir -p /var/www/html/ampache

-p 参数可确保父目录 var 和 www 在不存在时自动创建。

接下来,下载 Ampache 最新版本的 ZIP 压缩包。你可以从其 Github 发布页面找到最新版本的链接。在撰写本教程时,4.4.1 是最新版本,因此我们将下载该版本。

$ wget https://github.com/ampache/ampache/releases/download/4.4.1/ampache-4.4.1_all.zip

接下来,将 ZIP 文件解压到我们之前创建的目录中。

$ sudo unzip ampache-4.4.1_all.zip -d /var/www/html/ampache/

接下来,为 Nginx Web 服务器设置 /var/www/html/ampache 目录的权限。

$ sudo chown --recursive  nginx:nginx /var/www/html/ampache/

创建另一个目录来存储你的音乐。这里不需要 sudo,因为我们是在自己的用户目录中创建。

$ sudo mkdir -p /data/Music

将 /home/user/music 的所有权更改为 nginx,以便服务器可以在你将存储音乐的目录中写入和读取。

$ sudo chown -R nginx:nginx /data/Music

要完成 Ampache 的设置,请安装 FFmpeg,这是一个用于将音频和视频文件从一种格式转换为另一种格式的工具。Ampache 使用 FFmpeg 即时将音频文件从其上传的格式转换为收听设备可以播放的格式。

Fedora 默认不自带 FFmpeg,因此我们需要先添加 RPMFusion 仓库。

$ sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

接下来,安装 FFmpeg。

$ sudo dnf install ffmpeg

使用 Ampache 安装程序

你的 Ampache 网站已准备就绪,可以在浏览器中通过 https://example.com 访问。首次打开时,你将看到 Ampache 的 Web 安装程序。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

选择你的语言并继续到下一页,在那里你将看到你的服务器是否满足 Ampache 的要求。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

如果你正确按照本教程操作,那么你应该能够进入下一页,在那里你将被要求填写数据库详细信息。由于我们已经创建了数据库,因此可以保持其复选框不勾选。数据库用户也是如此。填写我们创建的数据库名称、用户和密码,然后继续到下一页。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

接下来,将向你显示 Ampache 的配置选项。大多数信息都是预填的,无需任何修改。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

出于某种原因,Ampache Web 安装程序无法检测到 Fedora 上已安装的 FFmpeg 二进制文件。我们稍后将通过手动编辑配置文件来启用它。

接下来,填写 Ampache 管理员账户的详细信息。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

现在你将被重定向到 Ampache 的登录页面。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

填写你的用户详细信息,现在你就可以访问 Ampache 播放器了。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

在开始使用之前,我们需要为转码启用 FFmpeg。为此,你需要打开 /var/www/html/ampache/config/ampache.cfg.php 文件进行编辑。

$ sudo nano /var/www/html/ampache/config/ampache.cfg.php

替换以下行

;transcode_cmd = "ffmpeg"

用以下行替换,即删除其前面的与号(&)符号。

transcode_cmd = "ffmpeg"

按 Ctrl + X 关闭编辑器,并在提示时按 Y 保存文件。你可以通过该文件进行更多你想要的更改。你的 Ampache 安装已准备就绪,但要使其正常工作,我们需要先向其中添加一些音乐。

添加音乐

要向 Ampache 添加音乐,我们需要在播放器中创建一个媒体库(catalog),然后从 Web 界面上传文件。

首先,使用主页上的 Add catalog 选项。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

选择 local 作为媒体库类型,并填写路径 /home/user/music 。如果你想导入播放列表,可以选择 Build Playlists from Playlist Files 选项。为你的媒体库命名,然后点击 Add Catalog 继续。

现在我们的媒体库已创建,我们需要启用能够上传音乐文件的选项。为此,请单击左上角工具栏中的第四个导航按钮以访问 Admin 设置。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

向下滚动到 Server Config 部分,然后单击 System 。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

找到 Allow user uploads 这一行,并从下拉菜单中选择 On 。你还可以选择允许添加文件的用户类型。在我们的例子中,是 Catalog Manager,它恰好也是管理员。

你还需要设置用户上传文件的目标位置。你可以使用 Destination catalog 这一行来设置。从下拉菜单中选择我们刚刚创建的媒体库。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

完成后单击 Update Preferences 。现在你可以向 Ampache 安装中添加音乐了。为此,请单击左上角导航菜单中的耳机图标。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

然后,单击 Music 部分中的 Upload 链接。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

在 Upload 页面上,从本地 PC 浏览并选择你的音乐文件,然后上传它们。如果你将 Artist 和 Album 字段留空,Ampache 将自动尝试根据文件本身的 ID3 标签进行识别。

在Fedora 33上安装Ampache音乐流媒体服务器的完整教程

完成后,你现在可以在左侧窗格的任意部分找到你的文件,并且可以流式播放你的音乐了。

结语

本教程介绍了如何在 Fedora 33 上安装和使用 Ampache 音乐流媒体服务器,到此结束。如果你有任何问题或反馈,请在下面的评论中发布。