Plan du site  
pixel
pixel

Articles - Étudiants SUPINFO

Setting up a media server

Par Maxence BRUTSAERT Publié le 11/09/2019 à 15:44:36 Noter cet article:
(0 votes)
En attente de relecture par le comité de lecture

Introduction

A media server is a space where we will store files such as photos or videos. The advantage of a media server is defined in the ability to access / share this content, whether it is locally or online.

This tutorial will present Jellyfin, a free multimedia software that will allow us to manage our multimedia content. Jellyfin's advantage over its competitors is that it is totally free and does not offer a license or paid features.

Thus our accounts are local, the confidentiality of our files is respected and all the indispensable but especially useful elements (ex: quality of streaming, bandwidth limitation, etc.) are present.

Jellyfin is a very recent software that started in December 2018 with the aim of taking over from Emby, another multimedia software that unfortunately went to Closed-Source.

Prerequisites

The implementation will require all of these prerequisites:

- A Debian server 9 accessible in SSH or locally.

- Root access

- A network connection

In addition, if you want to carry your server on the internet:

- A domain name

- A public IP

Installation

Let's start by installing the dependencies:

sudo apt update
sudo apt install apt-transport-https

This package allows us to download from an HTTPS repository. Subsequently we need to add the GPG key of the jellyfin repository:

wget -O - https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | sudo apt-key add -

Then add the jellyfin repository to our package manager:

echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/debian $( lsb_release -c -s ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list

Update of Jellyfin repositories and installation:

sudo apt update
sudo apt install jellyfin

After this command, check that the service is started:

sudo service jellyfin status

From there, Jellyfin should be accessible from http://server_ip:8096.

If not, check your firewall rules and add an exception for port 8096.

The suite is optional but remains mandatory if you want to secure and facilitate access to your media server:

Let's start with easy access, if you have a domain name or a local DNS, add a type A record pointing to your server IP address from a subdomain, such as media.mydomain.com.

Then let's set up the security of our server, we will therefore require an SSL certificate, for this tutorial I will use certificates generated by the certificate authority Let's Encrypt (https://letsencrypt.org/fr/). I let you inquire about the generation of these certificates, let's go directly to the establishment of a reverse proxy to our software.

Our reverse proxy will be built with Apache2, in the folder /etc/apache2/sites-availables, create a media.conf file to insert:

<VirtualHost *:80>
        ServerName media.mydomain.fr

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

        # Force HTTPS connection
        Redirect permanent / https://media.mondomaine.fr/
</VirtualHost>

<VirtualHost *:443>
        ServerName media.mydomain.fr

        SSLEngine on
        # Link to certificate
        SSLCertificateFile    /etc/ssl/fullchain.pem
        # Link to private key
        SSLCertificateKeyFile   /etc/ssl/privkey.pem
        SSLCipherSuite HIGH:!aNULL:!MD5:!ADH:!RC4:!DH
        SSLHonorCipherOrder on
        Header always set Strict-Transport-Security "max-age=15768000"

        ProxyPass / http://127.0.0.1:8096/
        ProxyPassReverse / http://127.0.0.1:8096/
</VirtualHost>

Remember to adapt the ServerName, SSLCertificate and Permanent Redirect settings according to your configuration.

Once the configuration is saved, we will need to activate some modules and the site:

sudo a2enmod proxy proxy_http ssl
sudo a2ensite media
sudo apache2 restart

Finally, our server is accessible on the address https://media.mydomain.fr/

You should arrive on this page:

Before going further we will configure folders where we will store our files:

sudo mkdir --parent /mediaserver/{photos,videos}

Change the permissions on these folders as needed.

Back on our page, we can start the installation thanks to the configuration agent. Choose the language, the nickname of the admin account and its password.

You will then be proposed to add a media library, let's import our files:

In the add window, you can choose the type of content, knowing that we will import photos and videos, select "Home videos & photos", then enter a display name, here I will indicate "Photos" for my picture folder.

By pressing '+' next to "Folder" we can choose a path to the directory where will be stored our files for the media library "Photos", be careful to indicate the absolute path, here we will have "/mediaserver/photos".

Finish the configuration by clicking OK and repeat this step for the video folder with this time the path "/mediaserver/videos".

Thus the files contained in the photos folder will be accessible from the Photos library and even for the videos contained in the videos folder that will be in the Videos library. These are accessible from the Jellyfin menu.

Then choose a language and country for metadata, and then on the remote access configuration page leave the first box checked if you want remote access.

Finish the configuration and you will be redirected to the login page. After logging in, the administration menu is accessible from "Dashboard". Here you can create users, configure the network settings of the service, add media libraries, etc.

Conclusion

Your media server is then functional, you can add media libraries, share your folders, or even watch live TV with a compatible device.

A propos de SUPINFO | Contacts & adresses | Enseigner à SUPINFO | Presse | Conditions d'utilisation & Copyright | Respect de la vie privée | Investir
Logo de la société Cisco, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société IBM, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sun-Oracle, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Apple, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sybase, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Novell, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Intel, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Accenture, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société SAP, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Prometric, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Toeic, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo du IT Academy Program par Microsoft, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management

SUPINFO International University
Ecole d'Informatique - IT School
École Supérieure d'Informatique de Paris, leader en France
La Grande Ecole de l'informatique, du numérique et du management
Fondée en 1965, reconnue par l'État. Titre Bac+5 certifié au niveau I.
SUPINFO International University is globally operated by EDUCINVEST Belgium - Avenue Louise, 534 - 1050 Brussels