在Ubuntu上配置Jellyfin媒體服務器的步驟如下:
sudo apt update
sudo apt upgrade -y
sudo apt install apt-transport-https ca-certificates gnupg curl -y
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
cat <<EOF | sudo tee /etc/apt/sources.list.d/jellyfin.sources
Types: deb
URIs: https://repo.jellyfin.org/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
sudo apt update
sudo apt install jellyfin -y
sudo systemctl is-enabled jellyfin
sudo systemctl status jellyfin
sudo systemctl start jellyfin
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw allow "WWW Full"
sudo ufw status
sudo apt install apache2 certbot python3-certbot-apache -y
sudo systemctl is-enabled apache2
sudo systemctl restart apache2
sudo mkdir -p /var/www/html/jellyfin/public_html
sudo chown -R www-data:www-data /var/www/html/jellyfin/public_html
sudo certbot certonly --agree-tos --email your_email@example.com --no-eff-email --webroot -w /var/www/html -d your_domain
sudo nano /etc/apache2/sites-available/jellyfin.conf
插入以下配置,根據需要更改域名、SSL證書路徑和服務器IP地址:
<VirtualHost *:80>
ServerName your_domain
Redirect permanent / https://your_domain/
ErrorLog ${APACHE_LOG_DIR}/your_domain-error.log
CustomLog ${APACHE_LOG_DIR}/your_domain-access.log combined
</VirtualHost>
<VirtualHost *:443>
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/"
</VirtualHost>
sudo systemctl restart apache2
訪問Jellyfin Web界面:
在瀏覽器中輸入 http://localhost:8096 或服務器的IP地址。
創建管理員賬戶: 首次訪問時,按照提示創建管理員賬戶。
添加媒體庫: 登錄后,點擊“Libraries”添加媒體庫,選擇媒體類型并添加媒體文件所在的目錄。Jellyfin會自動掃描并添加媒體庫。
完成配置后,點擊Jellyfin界面上的“啟動服務器”按鈕,服務器即可開始運行。
在支持DLNA或UPnP協議的任何設備上訪問Jellyfin服務器。在設備上打開媒體播放器或DLNA客戶端,瀏覽可用的媒體服務器,找到并訪問Jellyfin服務器。
請注意,以上步驟是基于Ubuntu系統的通用指南,具體配置可能會因系統版本或特定需求而有所不同。建議參考Jellyfin的官方文檔以獲取更詳細的指導。