117.info
人生若只如初见

如何在Ubuntu上安装Jellyfin

在Ubuntu上安装Jellyfin可以通过以下步骤完成:

安装Jellyfin

  1. 更新系统并安装必要的包
sudo apt update
sudo apt install apt-transport-https ca-certificates gnupg curl
  1. 创建keyrings目录并添加Jellyfin GPG密钥
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
  1. 添加Jellyfin仓库
cat <
  1. 更新包列表
sudo apt update
  1. 安装Jellyfin
sudo apt install jellyfin -y
  1. 验证Jellyfin服务
sudo systemctl is-enabled jellyfin
sudo systemctl status jellyfin
  1. 管理Jellyfin服务(如启动、停止、重启Jellyfin服务):
sudo systemctl start jellyfin
sudo systemctl stop jellyfin
sudo systemctl restart jellyfin
  1. 配置防火墙(如安装UFW并允许必要的服务):
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw allow "WWW Full"
sudo ufw status
  1. 安装Apache和Certbot用于SSL配置
sudo apt install apache2 certbot python3-certbot-apache -y
sudo systemctl is-enabled apache2
sudo systemctl status apache2
sudo a2enmod proxy proxy_http ssl proxy_wstunnel remoteip http2 headers
sudo systemctl restart apache2
  1. 设置Apache作为反向代理
  • 创建Jellyfin的web根目录并设置权限:
sudo mkdir -p /var/www/html/jellyfin/public_html
sudo chown -R www-data:www-data /var/www/html/jellyfin/public_html
  • 使用Certbot为你的域名获取SSL证书:
sudo certbot certonly --agree-tos --email your_email@gmail.com --no-eff-email --webroot -w /var/www/html -d your_domain
  • 创建一个新的Apache虚拟主机配置文件:
sudo nano /etc/apache2/sites-available/jellyfin.conf

插入以下配置,根据需要更改域名、SSL证书路径和服务器IP地址:


    ServerName your_domain
    # Comment to prevent HTTP to HTTPS redirect
    Redirect permanent / https://your_domain/
    ErrorLog ${APACHE_LOG_DIR}/your_domain-error.log
    CustomLog ${APACHE_LOG_DIR}/your_domain-access.log combined



    ServerName your_domain
    DocumentRoot /var/www/html/jellyfin/public_html
    ProxyPreserveHost On
    ProxyPass "/.well-known/" "!"
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
    ProxyPass "/socket" "ws://0.0.0.0:8096/socket"
    ProxyPassReverse "/socket" "ws://0.0.0.0:8096/socket"
    ProxyPass "/" "http://0.0.0.0:8096/"
    ProxyPassReverse "/" "http://0.0.0.0:8096/"
    IfModule mod_ssl.c
        SSLEngine on
        SSLCertificateFile /path/to/your_domain.crt
        SSLCertificateKeyFile /path/to/your_domain.key
    
  1. 重启Apache
sudo systemctl restart apache2

以上步骤涵盖了从更新系统包到配置SSL证书的完整安装流程,确保了Jellyfin媒体服务器的安全性和稳定性。

未经允许不得转载 » 本文链接:https://www.117.info/ask/fe010AzsKBgNUBlQ.html

推荐文章

  • ubuntu虚拟机如何升级系统版本

    要在Ubuntu虚拟机中升级系统版本,您可以按照以下步骤操作:
    准备工作 备份重要数据:在进行任何系统升级之前,请确保备份所有重要文件和数据,以防升级过程...

  • Ubuntu中如何删除不再使用的Aliases

    在Ubuntu中,删除不再使用的别名(Aliases)可以通过以下步骤完成: 打开终端(Terminal)。 使用文本编辑器打开.bashrc文件。这个文件通常位于用户的主目录下。...

  • Ubuntu Yum如何查看已安装的软件包

    在Ubuntu系统中,通常使用APT(Advanced Package Tool)来管理软件包,而不是YUM。YUM(Yellowdog Updater, Modified)主要用于基于RPM的Linux发行版,如Fedora、...

  • Ubuntu PHP日志中的脚本错误

    在Ubuntu系统中,PHP脚本错误通常记录在PHP错误日志中。要查看这些错误,您需要找到错误日志文件的位置。以下是一些方法来查找和解决PHP脚本错误: 查找PHP错误日...

  • 如何在Ubuntu中配置PHP的文件上传限制

    在Ubuntu中配置PHP的文件上传限制,你需要修改PHP的配置文件php.ini 打开终端(Terminal)。 使用文本编辑器打开php.ini文件。你可以使用nano或vim等编辑器。这里...

  • Ubuntu From Scratch性能怎样

    Ubuntu From Scratch (UFS) 是一个项目,它允许用户从零开始构建自己的 Ubuntu 操作系统。这个过程涉及到编译整个 Linux 内核以及应用程序,为用户提供高度定制化...

  • Linux C++调试技巧分享

    在Linux环境下使用C++进行编程时,调试是一个非常重要的环节。以下是一些常用的调试技巧和工具: GDB(GNU Debugger): GDB是Linux下最常用的调试器之一。你可以...

  • GIMP在Linux上如何添加插件

    在Linux系统上为GIMP添加插件通常涉及以下几个步骤: 下载插件:首先,你需要下载你想要安装的GIMP插件。这些插件可能以.scm、.py或其他格式提供,具体取决于插件...