웹사이트 검색

Fedora 33에 Ampache 음악 스트리밍 서버를 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. 방화벽 구성\n
  3. Git 설치
  4. MariaDB 설치
  5. Ampache용 MariaDB 구성
  6. PHP 설치
    1. PHP 확장 설치\n
    2. PHP-FPM 구성

    Ampache는 PHP로 작성된 오픈 소스 웹 기반 개인 오디오 스트리밍 애플리케이션입니다. 이를 통해 서버에서 디지털 음악 컬렉션을 호스팅 및 관리하고 컴퓨터, 스마트폰, 태블릿 또는 스마트 TV로 스트리밍할 수 있습니다. 다양한 iOS 애플리케이션을 사용하여 Ampache 음악 서버에서 개인 장치로 음악을 스트리밍할 수 있습니다.

    이 튜토리얼에서는 Fedora 33 기반 서버에 Ampache 애플리케이션을 설치하는 방법과 스트리밍을 위해 음악을 업로드하는 방법을 설명합니다.

    전제 조건

    • A server running Fedora 33.

    • A non-root sudo user.

    • Make sure everything is updated.

      $ sudo dnf upgrade
      
    • Few packages that your system needs.

      $ sudo dnf install wget curl nano zip -y
      
    • Disable SELinux.

      $ sudo setenforce 0
      

    방화벽 구성

    첫 번째 단계는 방화벽을 구성하는 것입니다. Fedora 서버는 Firewalld가 사전 설치된 상태로 제공됩니다.

    방화벽이 실행 중인지 확인하십시오.

    $ sudo firewall-cmd --state
    

    다음 출력을 얻어야 합니다.

    running
    

    방화벽의 기본 영역을 공개로 설정합니다.

    $ 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을 설치해야 합니다.

    $ sudo dnf install git
    

    다음으로 개인 정보로 Git을 구성합니다.

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

    MariaDB 설치

    MariaDB는 MySQL의 드롭인 대체품으로 MariaDB를 실행하고 작동하는 명령이 MySQL과 동일합니다.

    Fedora 33은 기본적으로 MariaDB 10.5가 안정적인 최신 버전이므로 MariaDB 10.4와 함께 제공되며 이를 위해 공식 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를 입력해야 합니다. 전자는 공식 저장소에서 설치하고 후자의 명령은 페도라 저장소.

    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
    

    다음 명령을 실행하여 루트 암호 제공, 익명 사용자 제거, 원격 루트 로그인 금지, 테스트 테이블 삭제와 같은 기본 구성을 수행합니다.

    $ sudo mysql_secure_installation
    

    MariaDB 10.4에서는 이제 루트 비밀번호를 사용할지 또는 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
    

    프롬프트가 표시되면 루트 비밀번호를 입력하십시오.

    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 리포지토리를 추가합니다.

    PHP 패키지 설치를 위한 공식 Fedora 리포지토리인 REMI 리포지토리를 설치합니다.

    $ 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=apachegroup=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_sizeupload_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가 제대로 작동하고 있음을 의미합니다.

    Nginx 구성

    서버 블록이 위치할 디렉토리를 설정합니다.

    $ 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
    

    Lets Encrypt를 사용하여 HTTPS 설정

    Lets 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 인수는 상위 디렉토리 varwww가 존재하지 않는 경우 자동으로 생성되도록 합니다.

    다음으로 최신 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 웹 서버의 /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의 웹 설치 프로그램이 반겨줄 것입니다.

    언어를 선택하고 서버가 Ampache에 대한 요구 사항을 충족하는지 표시되는 다음 페이지로 계속 진행하십시오.

    튜토리얼을 제대로 따랐다면 데이터베이스 세부 정보를 입력하라는 메시지가 표시되는 다음 페이지로 이동할 수 있습니다. 이미 데이터베이스를 만들었으므로 확인란을 선택하지 않은 상태로 둘 수 있습니다. 데이터베이스 사용자도 마찬가지입니다. 생성한 데이터베이스 이름, 사용자, 비밀번호를 입력하고 다음 페이지로 이동합니다.

    다음으로 Ampache의 구성 옵션이 표시됩니다. 대부분의 정보는 미리 채워져 있으며 수정할 필요가 없습니다.

    어떤 이유로 인해 Ampache 웹 설치 프로그램은 Fedora에 설치된 FFmpeg 바이너리를 감지하지 못합니다. 나중에 구성 파일을 수동으로 편집하여 활성화합니다.

    그런 다음 Ampache의 관리자 계정에 대한 세부 정보를 입력합니다.

    이제 Ampache의 로그인 페이지로 리디렉션됩니다.

    사용자 세부 정보를 입력하면 이제 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에 음악을 추가하려면 플레이어에서 카탈로그를 만든 다음 웹 인터페이스에서 파일을 업로드해야 합니다.

    먼저 홈페이지에서 카탈로그 추가 옵션을 사용하십시오.

    카탈로그 유형으로 로컬을 선택하고 /home/user/music 경로를 입력합니다. 재생 목록을 가져오려면 재생 목록 파일에서 재생 목록 만들기 옵션을 선택할 수 있습니다. 카탈로그에 이름을 지정한 다음 카탈로그 추가를 클릭하여 계속 진행합니다.

    이제 카탈로그가 생성되었으므로 음악 파일을 업로드할 수 있는 옵션을 활성화해야 합니다. 그렇게 하려면 왼쪽 상단 도구 모음에서 네 번째 탐색 버튼을 클릭하여 관리자 설정에 액세스하십시오.

    서버 구성 섹션까지 아래로 스크롤하고 시스템을 클릭합니다.

    사용자 업로드 허용 줄을 찾아 드롭다운 메뉴에서 켜기를 선택합니다. 파일을 추가할 수 있는 사용자 유형을 선택할 수도 있습니다. 우리의 경우 관리자이기도 한 카탈로그 관리자입니다.

    또한 사용자가 업로드한 파일의 대상을 설정해야 합니다. 대상 카탈로그 라인을 사용하여 이를 설정할 수 있습니다. 드롭다운 메뉴에서 방금 만든 카탈로그를 선택합니다.

    완료되면 기본 설정 업데이트를 클릭합니다. 이제 Ampache 설치에 음악을 추가할 수 있습니다. 이를 위해 왼쪽 상단 탐색 메뉴에서 헤드폰 아이콘을 클릭합니다.

    그런 다음 음악 섹션에서 업로드 링크를 클릭합니다.

    업로드 페이지에서 로컬 PC의 음악 파일을 찾아 선택하고 업로드합니다. 아티스트 및 앨범 필드를 비워 두면 Ampache는 자동으로 파일 자체의 ID3 태그를 사용하여 식별을 시도합니다.

    완료되면 이제 왼쪽 창의 모든 섹션에서 파일을 찾을 수 있으며 이제 음악을 스트리밍할 수 있습니다.

    결론

    이것으로 Fedora 33에서 제공하는 Ampache Music 스트리밍 서버를 설치하고 사용하는 방법에 대한 자습서를 마칩니다. 질문이나 피드백이 있는 경우 아래 의견에 게시하십시오.