Docker安装&配置jellyfin

域名通过备案,ECS不能浪费啊,搞个jellyfin服务器玩玩,虽然宽带小,用来听听歌还是绰绰有余的。

一、Docker安装jellyfin

这里使用的是nyanmisaka/jellyfin版本,据说全部驱动都已经全部安装好了。

docker pull nyanmisaka/jellyfin:latest

二、启用jellyfin

  1. 新建几个必须用的文件夹,如

    这三个目录建议配置,通过docker启动,如果不映射目录,就无法添加视频、音乐文件了。 media:存放媒体文件,后续全部电影、节目、音乐都放在此目录下 config:用于存放jellyfin的配置文件 cache:用于存放jellyfin的临时文件

  2. 启动jellyfin docker镜像

    -v /home/hotpod/.jellyfin/config:/config:映射目录,这里需要映射刚才创建的3个目录

docker run -d --name=Jellyfin -p 8096:8096 \
    -v /home/hotpod/.jellyfin/config:/config -v /home/hotpod/.jellyfin/cache:/cache -v /home/hotpod/media:/media \
    --add-host=api.themoviedb.org:13.224.161.90 \
    --add-host=api.themoviedb.org:13.35.8.65 \
    --add-host=api.themoviedb.org:13.35.8.93 \
    --add-host=api.themoviedb.org:13.35.8.6 \
    --add-host=api.themoviedb.org:13.35.8.54 \
    --add-host=image.tmdb.org:138.199.37.230 \
    --add-host=image.tmdb.org:108.138.246.49 \
    --add-host=api.thetvdb.org:13.225.89.239 \
    --add-host=api.thetvdb.org:192.241.234.54 \
    --restart unless-stopped \
    nyanmisaka/jellyfin:latest

三、反代jellyfin

  1. apache启用几个模块

    apache2使用反代功能,需要提前启用几个模块

sudo a2enmod rewrite
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo systemctl restart apache2.service

如果没有启用apache的proxy mod,启用阿帕车的代理功能会报错,如:

sudo systemctl reload apache2.service 
Job for apache2.service failed.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.

sudo apachectl configtest
AH00526: Syntax error on line 17 of /etc/apache2/sites-enabled/hotpod.conf:
Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
  1. 配置apache反代

    配置好反代配置文件后,重新加载apache即可。

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName www.hotpod.cn
        ServerAlias hotpod.cn

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
        ProxyPass "/"  "http://127.0.0.1:8096/"
        ProxyPassReverse "/"  "http://127.0.0.1:8096/"

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

results matching ""

    No results matching ""

    results matching ""

      No results matching ""