在CentOS上部署Jellyfin的步骤如下:
打开终端并运行以下命令来安装必要的依赖项:
sudo yum update -y
sudo yum install -y epel-release
sudo yum install -y git python3-pip python3-devel nginx
git克隆Jellyfin的官方仓库:git clone https://github.com/jellyfin/jellyfin.git
cd jellyfin
pip3 install -r requirements.txt
sudo systemctl stop nginx
sudo systemctl stop mariadb
sudo systemctl disable mariadb
sudo systemctl stop postgresql
sudo systemctl disable postgresql
# 如果你选择使用SQLite,则无需进行此步骤
# 如果你选择使用MariaDB或PostgreSQL,请创建数据库并配置Jellyfin连接信息
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql -u root -p
在MySQL中创建数据库和用户,并授予相应权限:
CREATE DATABASE jellyfin;
CREATE USER 'jellyfin'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON jellyfin.* TO 'jellyfin'@'localhost';
FLUSH PRIVILEGES;
EXIT;
sudo -u jellyfin ./jellyfin --init-db
sudo vi /etc/nginx/conf.d/jellyfin.conf
server {
listen 80;
server_name your_domain_or_ip;
location / {
proxy_pass http://localhost: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;
}
}
sudo systemctl start jellyfin
sudo systemctl start nginx
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
http://your_domain_or_ip,你应该能够看到Jellyfin的登录页面。