What is AirSonic
Airsonic is a free, web-based media streamer, providing ubiquitous access to your music. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously, for instance to one player in your kitchen and another in your living room. -https://airsonic.github.io/
- Log into the Linux device
- Run the following commands in a terminal window:
# update software repositories
sudo apt update
# install openjdk
sudo apt install default-jdk -y
# set java-home
sudo update-alternatives --config java
# create tomcat group and user
sudo mkdir /var/lib/tomcat9
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /var/lib/tomcat9 tomcat
# lookup the latest tomcat 9 release
regex='<a href="v[^/]*\/">v([^/]*)\/<\/a>' && response=$(curl -s https://downloads.apache.org/tomcat/tomcat-9/?C=M;O=D) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"
# download tomcat 9
curl -O https://downloads.apache.org/tomcat/tomcat-9/v$downloadURL/bin/apache-tomcat-$downloadURL.tar.gz
# extract tomcat 9
sudo tar xzvf apache-tomcat-9*tar.gz -C /var/lib/tomcat9 --strip-components=1
# create directories and set permissions
sudo mkdir /var/airsonic/
sudo chown -R tomcat:tomcat /var/airsonic/
cd /var/lib/tomcat9
sudo chgrp -R tomcat /var/lib/tomcat9
sudo chmod -R g+r conf
sudo chmod g+x conf
sudo chown -R tomcat webapps/ work/ temp/ logs/
# run tomcat as a service
sudo update-java-alternatives -l
sudo nano /etc/systemd/system/tomcat.service - Paste the following configuration into tomcat.service
[Unit]
Description=Apache Tomcat
After=network.target[Service]
ReadWritePaths=/var/airsonic/
Type=forkingExecStart=/var/lib/tomcat9/bin/startup.sh
ExecStop=/var/lib/tomcat9/bin/shutdown.shUser=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always[Install]
WantedBy=multi-user.target - Continue with the following commands in terminal:
Install AirSonic
- Continue with the following commands in terminal:
- Back in the web browser, navigate to http://DNSorIP:8080/airsonic
- Login to AirSonic with username admin and password admin
- Welcome to AirSonic
- Click the Change administrator password link
- Check the Change password box
- Input the new password twice and click the Save button