CentOS中Jellyfin的默认端口设置及配置方法
Jellyfin在CentOS系统中的默认端口主要用于Web界面访问、媒体流传输及设备通信,具体如下:
http://服务器IP:8096进入设置页面);https://服务器IP:8920);sudo systemctl start jellyfin;http://服务器IP:8096,使用默认账号(admin/admin)登录;sudo systemctl restart jellyfin。/etc/jellyfin/config/config.yaml;server部分,调整port(HTTP端口)和ssl_port(HTTPS端口,若启用)的值,例如:server:
port: 8080 # 修改为自定义端口
bind_ip: 0.0.0.0 # 绑定所有IP(若需限制为本地IP,改为127.0.0.1)
Ctrl+X→Y→Enter保存文件,重启Jellyfin服务:sudo systemctl restart jellyfin。若CentOS启用了firewalld防火墙,需放行Jellyfin使用的端口,否则无法通过网络访问:
sudo firewall-cmd --permanent --zone=public --add-port=8096/tcp(若修改了端口,替换为自定义端口);sudo firewall-cmd --permanent --zone=public --add-port=8920/tcp;sudo firewall-cmd --permanent --zone=public --add-port=1900/udp;sudo firewall-cmd --permanent --zone=public --add-port=5353/udp;sudo firewall-cmd --reload。若通过Docker安装Jellyfin,需在运行容器时将主机的端口映射到容器的默认端口(8096),例如:
docker run -d --name my_jellyfin -p 80:8096 --restart always --privileged=true \
-v /srv/jellyfin/config:/config -v /srv/jellyfin/cache:/cache -v /media:/media \
jellyfin/jellyfin:latest
上述命令将主机的80端口映射到容器的8096端口,可通过http://服务器IP直接访问(无需输入端口号)。