在Ubuntu上使用Jellyfin进行媒体库管理是一个相对简单的过程。以下是一些关键步骤,帮助你完成安装和配置:
sudo apt update
sudo apt install apt-transport-https ca-certificates gnupg curl
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: $(lsb_release -rs)
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
sudo apt update
sudo apt install jellyfin -y
sudo systemctl status jellyfin
sudo systemctl start jellyfin
sudo systemctl stop jellyfin
sudo systemctl restart 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 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@gmail.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>
访问Jellyfin的Web界面:在浏览器中输入 http://localhost:8096
,首次访问时需要进行一些基本配置,如创建管理员账户、添加媒体库等。
添加媒体库:在Jellyfin的Web界面中,点击“Libraries”来添加媒体库,可以是视频、音频、图片等。选择要添加的媒体类型,然后选择该媒体文件所在的目录,Jellyfin会自动扫描并添加该媒体库。
播放媒体:添加完媒体库后,你可以在Jellyfin中浏览和播放你的媒体文件。点击媒体库中的文件即可开始播放。
其他功能:Jellyfin还提供了许多其他功能,如用户管理、插件支持、远程访问等。你可以通过Jellyfin的Web界面来进行相应的设置和操作。
通过以上步骤,你就可以在Ubuntu上成功安装和配置Jellyfin,并开始管理你的媒体库了。