Benutzer-Werkzeuge

Webseiten-Werkzeuge


ubuntu:airsonic

Dies ist eine alte Version des Dokuments!


Airsonic (Advanced) Streamingserver

Installation

Java JRE

Wie auch Subsonic ist Airsonic in Java geschrieben. Daher wird für den Betrieb das Java Runtime Environment in der Version 8 benötigt:

# aptitude install openjdk-8-jre

Für Airsonic Advanced wird Java 11 benötigt:

# aptitude install openjdk-11-jre

Falls bereits eine andere Java-Version installiert worden ist, kann über den folgenden Befehl Java 8 zum Systemstandard gemacht werden.

# update-alternatives --config java

Um zu erfahren, welche Java-Version Systemstandard ist, kann folgender Aufruf getätigt werden:

# java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~20.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

Optionale Tools

Optional können noch folgende Tools zur Bearbeitung der Musiksammlung installiert werden:

aptitude install id3 id3v2 eyed3

Das System vorbereiten

Umlegen des Arbeitsverzeichnises auf eine andere Platte:

# mkdir -p /srv/airsonic
# cd /var
# ln -s  /srv/airsonic airsonic

Nun legen wir das Dienstkonto an:

# useradd -M -r -s /usr/sbin/nologin -d /var/airsonic airsonic
# chown -R airsonic:airsonic /srv/airsonic

Die Anwendung als Dienst implementieren

Bei Airsonic:

# wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic.service -O /etc/systemd/system/airsonic.service
# wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic-systemd-env -O /etc/default/airsonic
# wget -c https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war
# cp airsonic.war /srv/airsonic
# systemctl daemon-reload
# systemctl start airsonic.service
# systemctl enable airsonic.service

Bei Airsonic Advanced:

# wget https://raw.githubusercontent.com/airsonic-advanced/airsonic-advanced/master/contrib/airsonic.service -O /etc/systemd/system/airsonic.service
# wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic-systemd-env -O /etc/default/airsonic
# wget -c https://github.com/airsonic-advanced/airsonic-advanced/releases/download/11.0.0-SNAPSHOT.20211007145752/airsonic.war
# cp airsonic.war /srv/airsonic
# systemctl daemon-reload
# systemctl start airsonic.service
# systemctl enable airsonic.service

Innerhalb der airsonic.service muss der Pfad für EnvironmentFile an die Gegebenheiten in Ubuntu angepasst werden.

/etc/systemd/system/airsonic.service
[Unit]
Description=Airsonic Media Server
After=remote-fs.target network.target
AssertPathExists=/var/airsonic
 
[Service]
Type=simple
Environment="JAVA_JAR=/var/airsonic/airsonic.war"
Environment="JAVA_OPTS=-Xmx700m"
Environment="AIRSONIC_HOME=/var/airsonic"
Environment="PORT=8080"
Environment="CONTEXT_PATH=/airsonic"
Environment="JAVA_ARGS="
EnvironmentFile=-/etc/default/airsonic
ExecStart=/usr/bin/java \
          $JAVA_OPTS \
          -Dairsonic.home=${AIRSONIC_HOME} \
          -Dserver.servlet.context-path=${CONTEXT_PATH} \
          -Dserver.port=${PORT} \
          -jar ${JAVA_JAR} $JAVA_ARGS
User=airsonic
Group=airsonic
 
# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# for details
DevicePolicy=closed
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap
ReadWritePaths=/var/airsonic
 
# You can change the following line to `strict` instead of `full`
# if you don't want airsonic to be able to
# write anything on your filesystem outside of AIRSONIC_HOME.
ProtectSystem=full
 
# You can uncomment the following line if you don't have any media
# in /home/…. This will prevent airsonic from ever reading/writing anything there.
#ProtectHome=true
 
# You can uncomment the following line if you're not using the OpenJDK.
# This will prevent processes from having a memory zone that is both writeable
# and executeable, making hacker's lifes a bit harder.
#MemoryDenyWriteExecute=yes
 
 
[Install]
WantedBy=multi-user.target

Reverse Proxy

Apache

Installation

# aptitude install apache2
# a2enmod proxy proxy_http headers proxy_wstunnel
ubuntu/airsonic.1633867545.txt.gz · Zuletzt geändert: von Sebastian Hetzel

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki