Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Jellyfin bụ ngwa mgbasa ozi n'efu, mepere emepe emebere iji hazie, jikwaa na kesaa faịlụ mgbasa ozi dijitalụ na ngwaọrụ netwọk na netwọk dị n'ime yana enwere ike ịnweta ya ozugbo achọrọ ya. Ọ bụ ikpo okwu na ụzọ ọzọ maka ndị isi egwuregwu ndị ọzọ, Plex na Emby. Ị nwere ike ịnweta ya site na ngwaọrụ dị iche iche dị ka Mobile, Tablets, TV, na PC ma ọ bụ ngwaọrụ mgbasa ozi ewu ewu dị ka Roku ma ọ bụ Nvidia Shish. Jellyfin na-arụkwa ọrụ mgbasa ozi na ngwaọrụ DLNA na Chromecast nwere ike weta metadata dịka Plex na Emby na-eme ka ị nwee ike hazie mgbasa ozi gị ka ọ bụrụ edemede na ahụmịhe mgbasa ozi bara ụba.

Ọ bụrụ na ị ga-achọ ịnwale, Jellyfin kere a ihe nkesa ngosi ịbanye wee lelee ya n'onwe gị.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

N'ime nkuzi a, ị ga-amụta Otu esi etinye Jellyfin na Ubuntu 20.04 Focal Fossa, yana otu esi edozi draịva mgbasa ozi gị ka ọ nwee ohere ịgụ na ide ziri ezi, gbakwunyere ma ọ bụrụ na ịchọrọ ịkwanye ihe Apache or Nginx tụgharịa proxy nhọrọ remotely na otu esi echedo ya Ka anyị zoo SSL efu asambodo maka ngwa webụ abụọ.

Prerequisites

  • OS akwadoro: Ubuntu 20.04 - nhọrọ (Ubuntu 21.04)
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ma ọ bụ ohere mgbọrọgwụ.

Na-emelite Sistemụ Ọrụ

Melite gi Ubuntu 20.04 sistemụ arụmọrụ iji hụ na ngwugwu niile dị kwalitere ruo ugbu a:

sudo apt update && sudo apt upgrade

Wụnye dabere:

Ị ga-achọ ijide n'aka na etinyere ngwugwu ndị a iji mee nke ọma ịwụnye Jellyfin Media server:

sudo apt install apt-transport-https ca-certificates gnupg2 curl git -y

Ọ bụrụ na ị maghị, mee naanị iwu ahụ; ọ gaghị emerụ gị ahụ.


Advertisement


Wụnye Jellyfin Media Server

Jellyfin anaghị abịa na ebe nchekwa ndabere nke Ubuntu 20.04, yabụ ị ga-emerịrị ya bubata igodo Jellyfin GPG na ebe nchekwa.

Bubata igodo GPG

Mbụ, ị ga-ebubata igodo GPG iji chọpụta na ngwugwu ahụ bụ eziokwu; na-enweghị ya, nrụnye ga-ada:

wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo apt-key add -

Ọ bụrụ na ebubata ya nke ọma, ị ga-enweta nsonaazụ na-esote n'ọnụ ọnụ gị:

OK

Bubata ebe nchekwa

Nzọụkwụ ọzọ bụ ibubata ebe nchekwa:

echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/jellyfin.list

Iji mechaa, melite ndepụta nchekwa gị ka ịmata mgbakwunye ọhụrụ dị ka ndị a:

sudo apt update

Wụnye Jellyfin

Ugbu a ị nwere ahaziri ebe nchekwa nke dabara adaba, ị nwere ike ịga n'ihu itinye ihe nkesa mgbasa ozi site na iji iwu a:

sudo apt install jellyfin

Mwepụta ihe atụ nwere ntụkwasị obi agbakwunyere nke a ga-etinye:

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ụdị Y, mgbe ahụ pịa igodo tinye iji wuchaa echichi.

Ozugbo etinyere ya, a ga-amalite ọrụ Jellyfin ozugbo. Iji kwado nke a, jiri ihe ndị a systemctl iwu:

systemctl status jellyfin

Ihe atụ mmepụta:

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ọ bụrụ na ebidobeghị ihe nkesa mgbasa ozi gị maka ihe ụfọdụ, jiri iwu ndị a:

Iji malite:

sudo systemctl start jellyfin

Iji mee ka usoro buut rụọ ọrụ:

sudo systemctl enable jellyfin

Ntọala izizi Jellyfin Media Server

Iji nweta Jellyfin Weebụ UI, ị ga-emeperịrị ihe nchọgharị ịntanetị gị wee tinye 127.0.0.1 na ọdụ ụgbọ mmiri Jellyfin ndabara 8096.

Ọmụmaatụ n'okpuru:

http://127.0.0.1:8096

Ị ga-ahụ ihuenyo nnabata maka nhazi nkesa mbụ.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Họrọ gị Asụsụ ngosi masịrị ma pịa na Ọzọ -> bọtịnụ aga n'ihu.

Ọzọ, ị ga-ahụ na ịmepụta aha njirimara na paswọọdụ.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Mepụta aha njirimara na paswọọdụ; dị ka ekwuru na foto a dị n'elu, enwere ike itinye ndị ọrụ karịa ozugbo nhazi mbụ agwụla. Ozugbo emechara, pịa na Ọzọ -> bọtịnụ aga n'ihu.

Ugbu a ị nwere ike ịtọ ọba akwụkwọ mgbasa ozi gị.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Pịa na nnukwu + (Akara gbakwunyere) or Tinye Media Library bọtịnụ. Site na ebe a, ị nwere ike itinye folda mgbasa ozi gị, nhazi ahụ kwụ ọtọ, ndị ọrụ Plex ga-enwekwa mmetụta dị nso na ya. Ozugbo emechara, pịa Ọzọ -> bọtịnụ ga n'ihu.

Ihuenyo na-esote bụ ihuenyo Metadata Langauge:

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Họrọ gị asụsụ, wee pịa Ọzọ -> bọtịnụ.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ọ bụrụ na ị ga-eji ma ọ bụ, n'okwu ka mma ịnweta ihe nkesa site na mpụga na ma ọ bụ n'azụ proxy, jide n'aka na ịtọọ Kwe ka njikọ dịpụrụ adịpụ na nkesa a dị ka ndabere ndabere na nke a. Ọ bụrụ na ị na-enweta naanị netwọkụ mpaghara, gbanyụọ nke a.

Ugbu a, ị ga-ahụ ihuenyo na-ekwu na ị dechara echichi.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Nzọụkwụ dị mfe, pịa na Emechaa bọtịnụ imecha n'ezie.

A ga-akpọrọ gị gaa na ihuenyo nbanye iji banye na akaụntụ njirimara na paswọọdụ ị mepụtara na nhazi mbụ.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ugbu a ị ga-anọ na dashboard gị.

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ọ bụrụ na ị melite mgbasa ozi n'oge echichi, ọ ga-amalite na-akpaghị aka.

Tọgharia Mbido mbụ

Ọ bụrụ na ịmee njehie n'oge nhazi mbụ ị nwere ike ịlaghachi na usoro ndị a:

Mepee faịlụ system.xml:

sudo nano /etc/jellyfin/system.xml

Gbanwee ihe ndị a, nke dị na ahịrị 4:

<IsStartupWizardCompleted>true</IsStartupWizardCompleted>

Maka nke a:

<IsStartupWizardCompleted>false</IsStartupWizardCompleted>

Malitegharịa ekwentị Jellyfin:

sudo systemctl restart jellyfin

Ugbu a ị tọgharịa ntọala mbụ, gaa na nke ahụ HTTP://127.0.0.1:8096 ma malitegharịa usoro ahụ ọzọ.


Advertisement


Nhazi ikike maka draịva mgbasa ozi

Jellyfin ga-achọ ka ọ gụọ ma mebie ikike na akwụkwọ ndekọ aha mgbasa ozi gị. Ị nwere ike iji chown ma ọ bụ chgrp iwu; Otú ọ dị, ị ga-amụta iji setfacl iwu maka nkuzi . A na-ekpuchi nke a ebe ọ bụ na ọ nwere ikike, emesịa, ka ọ dịkwuo nchebe, ma ị nwere ike ijikwa ohere ịnweta na ọkwa zuru oke ma e jiri ya tụnyere ụzọ ndabara. chown na chgrp.

Iji wụnye, mee iwu a:

sudo apt install acl -y

Ugbu a, ị nwere nhọrọ ole na ole na setfalc iwu, ma n'ezie, ị gaghị aga site na-enye onye ọ bụla ihe nkiri na ihe nkiri TV ikike; kama, ụzọ dị mfe bụ iji ọkọlọtọ recursive (-R) nke ahụ ga-enye Jellyfin ohere ọ chọrọ maka ihe ọ bụla dị na ndekọ na subdirectories.

sudo setfacl -R -m u:jellyfin:rx /media/mymediadrive

Ọ bụrụ na ịchọrọ ịnye ikike na akwụkwọ ndekọ aha mgbasa ozi ma ọ bụ faịlụ, jiri ihe ndị a:

sudo setfacl -m u:jellyfin:rx /media/mymediadrive/example-name-of-file-or-directory

Tọọ Apache ka ọ bụrụ onye nnọchi anya azụ

Ị nwere ike ịtọ proxy reverse iji nweta Jellyfin site na kọmputa ma ọ bụ netwọk dịpụrụ adịpụ. N'ọmụmaatụ a, nkuzi ga-edozi ihe nkesa proxy Apache. Ọ bụrụ n’ịchọrọ iji Nginx, mafee akụkụ a wee gaa na ya Tọọ Nginx ka ọ bụrụ onye nnọchi anya azụ.

Nke mbụ, wụnye Apache:

sudo apt install apache2 -y

Site na ndabara, Apache kwesịrị ịgbanye ma ọ bụrụ na agbaghị ya ọrụ. jiri:

sudo systemctl start apache2

Iji mee ka Apache malite na buut, jiri iwu a:

sudo systemctl enable apache2

Mwepụta ihe atụ ma ọ bụrụ na ọ ga nke ọma:

Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2

Nyochaa ọkwa Apache:

sudo systemctl status apache2

Ihe atụ mmepụta:

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Iji jiri Apache dị ka onye nnọchi anya, ị ga-eme ka modul ahụ nwee iwu a:

sudo a2enmod proxy proxy_http headers proxy_wstunnel

Na-esote, mepụta mebere nnabata maka subdomain gị:

sudo nano /etc/apache2/sites-available/jellyfin.conf

Ị ga-achọ ngalaba aha na-arụsi ọrụ ike nke enwere ike ịzụta maka ihe dị ka 1 ruo 2 dollar ma ọ bụrụ na ịnweghị otu. AhaCheap nwere ngalaba dị ọnụ ala kachasị mma na-aga gburugburu ma ọ bụrụ na ịchọrọ .com, jiri Igwe ojii.

Mgbe ịmechara ngalaba ngalaba gị, tinye ihe ndị a na faịlụ ngọngọ sava:

<VirtualHost *:80>
   ServerName jellyfin.example.com
   ErrorDocument 404 /404.html

   #HTTP proxy
   ProxyPass / http://localhost:8096/
   ProxyPassReverse / http://localhost:8096/

   #Websocket proxy
   SSLProxyEngine on
   <Location /:/websockets/notifications>
        ProxyPass wss://localhost:8096/:/websockets/notifications
        ProxyPassReverse wss://localhost:8096/:/websockets/notifications
   </Location>

   Header always unset X-Frame-Options
</VirtualHost>

Chekwaa faịlụ (Ctrl+O), wee pụọ (CTRL+X).

Ugbu a, mee ọsọ ọsọ iji jide n'aka na ọ nweghị njehie na nhazi Apache ma ọ bụ onye nnabata gị:

sudo apache2ctl configtest

Ọ bụrụ na ihe niile na-arụ ọrụ nke ọma, ihe atụ kwesịrị ịbụ:

Syntax OK

Kwado onye nnabata mebere na Apache dị ka ndị a:

sudo a2ensite jellyfin.conf

Mgbe ahụ malitegharịa Apache:

sudo systemctl restart apache2

Advertisement


Tọọ Nginx ka ọ bụrụ onye nnọchi anya azụ

Ị nwere ike ịtọ proxy reverse iji nweta Jellyfin site na kọmputa ma ọ bụ netwọk dịpụrụ adịpụ. N'ọmụmaatụ a, nkuzi ga-edozi ihe nkesa proxy Nginx.

Nke mbụ, wụnye Nginx:

sudo apt install nginx -y

Site na ndabara, ekwesịrị ịgbanye Nginx ma ọ bụrụ na agbaghị ya ọrụ. jiri:

sudo systemctl start nginx

Iji mee ka Nginx malite na buut, jiri iwu a:

sudo systemctl enable nginx

Mwepụta ihe atụ ma ọ bụrụ na ọ ga nke ọma:

Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx

Chọpụta ọkwa Nginx:

sudo systemctl status nginx

Ihe atụ mmepụta:

Otu esi etinye Jellyfin Media Server na Ubuntu 20.04

Ugbu a, mepụta ngọngọ sava ọhụrụ dị ka ndị a:

sudo nano /etc/nginx/conf.d/jellyfin.conf

Ị ga-achọ ngalaba aha na-arụsi ọrụ ike nke enwere ike ịzụta maka ihe dị ka 1 ruo 2 dollar ma ọ bụrụ na ịnweghị otu. AhaCheap nwere ngalaba dị ọnụ ala kachasị mma na-aga gburugburu ma ọ bụrụ na ịchọrọ .com, jiri Igwe ojii.

Mgbe ịmechara ngalaba ngalaba gị, tinye ihe ndị a na faịlụ ngọngọ sava:

server {
      listen 80;
      server_name jellyfin.example.com;

      access_log /var/log/nginx/jellyfin.access;
      error_log /var/log/nginx/jellyfin.error;

      set $jellyfin 127.0.0.1;

      location / {
          proxy_pass http://127.0.0.1:8096;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;

          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Forwarded-Protocol $scheme;
          proxy_set_header X-Forwarded-Host $http_host;

          # Disable buffering when the nginx proxy gets very resource heavy upon streaming
          proxy_buffering off;
      }

      # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/
      location ~ ^/web/$ {
          # Proxy main Jellyfin traffic
          proxy_pass http://$jellyfin:8096/web/index.html/;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Forwarded-Protocol $scheme;
          proxy_set_header X-Forwarded-Host $http_host;
      }

      location /socket {
          # Proxy Jellyfin Websockets traffic
          proxy_pass http://$127.0.0.1:8096;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Forwarded-Protocol $scheme;
          proxy_set_header X-Forwarded-Host $http_host;
      }

        # Security / XSS Mitigation Headers
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";
}

Chekwaa faịlụ (Ctrl+O), wee pụọ (CTRL+X).

Ugbu a, mee ọsọ ọsọ iji jide n'aka na ọ dịghị njehie na nhazi Nginx ma ọ bụ ngọngọ nkesa gị:

sudo nginx -t

Ọ bụrụ na ihe niile na-arụ ọrụ nke ọma, ihe atụ kwesịrị ịbụ:

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

Bugharịa Nginx maka mgbanwe ahụ ka ọ rụọ ọrụ:

sudo systemctl reload nginx

Ọ bụrụ na ịtọlitela ngalaba gị na ndekọ DNS iji rụtụ aka na IP nkesa gị, ị nwere ike nweta Jellyfin Media Server gị ugbu a. jellyfin.example.com.

Chekwaa Nginx ma ọ bụ Apache na ka anyị zoo SSL Asambodo efu

Dị ka o kwesịrị, ị ga-achọ ịgba ọsọ Apache ma ọ bụ Nginx gị HTTPS na-eji asambodo SSL. Ụzọ kacha mma isi mee nke a bụ iji Ka anyị zoo, ikike asambodo efu, akpaaka na mepere emepe nke ndị Otu nyocha nchekwa ịntanetị anaghị akwụ ụgwọ (ISRG).

Mbụ, wụnye ngwugwu certbot dị ka ndị a:

Apache:

sudo apt install python3-certbot-apache -y

Nginx:

sudo apt install python3-certbot-nginx -y

Ozugbo arụnyere, gbanye iwu a ka ịmalite imepụta asambodo gị:

Apache:

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com

Nginx:

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com

Nke a bụ ezigbo ntọala nke gụnyere ike HTTPS 301 redirects, Strict-Transport-Security nkụnye eji isi mee, na OCSP Stapling. Naanị jide n'aka na ịhazigharịa e-mail na ngalaba aha na ihe ị chọrọ.

Ugbu a URL gị ga-abụ https://jellyfin.example.com kama HTTP://jellyfin.example.com.

Rịba ama, ọ bụrụ na ị na-eji nke ochie URL HTTP, ọ ga-akpaghị aka redirect gaa na HTTPS.


Advertisement


Na-emelite Jellyfin Media Server

Enwere ike imelite Jellyfin dịka ọ dị na nkịtị iwu mmelite dabara adaba na ị ga-eji ọtụtụ oge gị kwalite ngwugwu na sistemụ gị.

Ka ịlele maka mmelite:

sudo apt update

Ọ bụrụ otu dị, jiri iwu nkwalite:

sudo apt upgrade

Okwu na mmechi

Nkuzi a ekpuchila ntakịrị nke ịwụnye Jellyfin na Ubuntu 20.04 yana ịtọlite ​​​​ikike na ohere dịpụrụ adịpụ site na Apache ma ọ bụ Nginx. N'ozuzu, ihe nkesa mgbasa ozi bụ ọrụ na-adọrọ mmasị. Ọ bụ ihe na-adịghị mma ma na-atọ ụtọ na anya ma na-arụ ọrụ nke ọma na igbe ahụ. Ọ bụrụ na ị bụ onye ọrụ Plex ma ọ bụ Emby ogologo oge, ọ dị mma ileba anya na nke a ka ọ bụrụ ihe ọzọ ma ọ bụrụ na ịchọghị ịgbanwe ya ugbu a n'ihi na nke a nwere ike ịbụ onye nzọpụta bara uru.

4 echiche na "Otu esi etinye Jellyfin Media Server na Ubuntu 20.04"

  1. Jọshụa, esonyere m ndụmọdụ gị iji wụnye Jellyfin na sava m raara onwe ya nye na https://3.n2bible.com na mụ na ndị otu ụka m enweghị nsogbu ịnweta na iji nkwanye sitere na ya, mana ndị enyi m niile nọ na China nwere nsogbu ịnweta ya.

    zaghachi
    • Ndewo Aubrey,

      Daalụ maka ozi ahụ, firewall China na-egbochi ya? Ihe nkesa dị n'ime ma ọ bụ na mpụga China enwere m ike ịjụ?

      Ekele.

      zaghachi

Ahapụ a Comment