User Tools

Site Tools


computing:airsonic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:airsonic [2019/12/18 06:19] oemb1905computing:airsonic [2023/12/25 18:23] (current) oemb1905
Line 1: Line 1:
-Airsonic server (in progress)+------------------------------------------- 
 +  * **airsonic**  
 +  * **Jonathan Haack** 
 +  * **Haack's Networking** 
 +  * **netcmnd@jonathanhaack.com** 
 + 
 +------------------------------------------- 
 + 
 +//airsonic//       
 + 
 +------------------------------------------- 
 + 
 +Folks these days would love to be able to stream their own music as effortlessly as Spotify, Apple Music, and other proprietary services, but often do not know how to do so.  This tutorial is designed to provide a free software solution for music and media streaming.  Before beginning, make sure to setup LAMP/TLS on Debian first, and you can use [[https://wiki.haacksnetworking.com/doku.php?id=computing:apachesurvival|Apache Survival]]. I used the AirSonic [[https://airsonic.github.io/docs/|documentation]] and some forums, etc., to set up a reverse proxy (on an alternate port 8081to run an AirSonic media server instance.  I should also mention that the media directories I am using are simultaneously hosted within a [[https://wiki.haacksnetworking.com/doku.php?id=computing:nextcloud|Nextcloud]] instance on the same localhost.  The two services work in unison flawlessly and here are my findings and instructions:
  
   sudo apt install tomcat9   sudo apt install tomcat9
Line 5: Line 17:
   nano server.xml   nano server.xml
  
-change port to needed port (8081)+Change port to needed port (8081)
  
-  wget https://github.com/airsonic/airsonic/releases/download/v10.5.0/airsonic.war+  wget https://github.com/airsonic-advanced/airsonic-advanced/releases/download/11.0.0-SNAPSHOT.20230217142243/airsonic.war 
 +  mv airsonic.war /var/airsonic/
   gpg --keyserver keyserver.ubuntu.com --recv 0A3F5E91F8364EDF   gpg --keyserver keyserver.ubuntu.com --recv 0A3F5E91F8364EDF
   wget https://github.com/airsonic/airsonic/releases/download/v10.5.0/artifacts-checksums.sha.asc   wget https://github.com/airsonic/airsonic/releases/download/v10.5.0/artifacts-checksums.sha.asc
   gpg --verify artifacts-checksums.sha.asc   gpg --verify artifacts-checksums.sha.asc
   sha256sum -c artifacts-checksums.sha.asc   sha256sum -c artifacts-checksums.sha.asc
 +  sudo rm /var/lib/tomcat9/webapps/airsonic.war 
 +  sudo rm -R /var/lib/tomcat9/webapps/airsonic/ 
 +  sudo rm -R /var/lib/tomcat9/work/*
   sudo mkdir /var/airsonic/   sudo mkdir /var/airsonic/
-  sudo chown -R tomcat:tomcat /var/airsonic/ +  sudo chown -R $USER:$USER /var/airsonic/ 
 +  cd /var/airsonic/ 
 +  ln -s /home/nextclouddata/username/files/Music/Masters music
   sudo systemctl stop tomcat9.service   sudo systemctl stop tomcat9.service
 +  screen
 +  java -jar -Dserver.port=8081 /var/airsonic/airsonic.war
 +  <ctrl-a-d>
 +  
 +Once you detach from the screen, this will remain running until reboot. Navigate to:
 +
 +  localhost:8081
 +  
 +Or, if you need to set up your instance for external access and already set up LAMP or FEMP or something equivalently secure, then you would navigate to:
 +
 +  https://domain.com
 +
 +Personally, I do leverage external access and I use apache and these virtual host configurations:  [[https://repo.haacksnetworking.com/oemb1905/haackingclub/tree/master/airsonic|Air Sonic Virtual Host Configuration Examples]].  Also, I will organize this later, but here is how to make sure the transcoder is working:
 +
 +  mkdir /var/airsonic/transcode
 +  cd transcode/
 +  ln -s /usr/bin/ffmpeg
 +  chown -h user:user ffmpeg
 +  ls -alh
 +  <lrwxrwxrwx 1 user user   15 mai    4 19:57 ffmpeg -> /usr/bin/ffmpeg>
 +
 +Okay, so AirSonic is deprecated and now there is AirSonic advanced. You can download the current ''.jar'' files here:
 +
 +  https://github.com/airsonic-advanced/airsonic-advanced/releases
 +  wget https://github.com/airsonic-advanced/airsonic-advanced/releases/download/11.0.0-SNAPSHOT.20220625052932/airsonic.war
 +  
 +Once you run the .war it will create all necessary sub folders. I am still not clear on how to migrate meta-data between instances. The wget above is for the .war that is current as of this post; make sure to always check. Also, if your server stops/reboots, then you need a script to make sure that airsonic is running, and if not, to start it. To do that, I created the following:
 +
 +  #!/bin/sh
 +  DATE=`date +"%Y%m%d-%H:%M:%S"`
 +  if
 +  ps -ef | grep "java -jar" > /home/sexa/Desktop/airsonic-tmp.log
 +  tail -n -2 /home/sexa/Desktop/airsonic-tmp.log | grep "java -jar -Dserver.port=8081 /var/airsonic/airsonic.war"
 +  then
 +  echo "Arisonic was running at $DATE" >> /home/sexa/Desktop/airsonic-ok.log
 +  else
 +  export TERM='vt100'
 +  su - airsonic <<SHT
 +          script
 +          screen -S airsonic bash -c "java -jar -Dserver.port=8081 /var/airsonic/airsonic.war; bash"
 +  SHT
 +  fi
 +
 +I tested this and it runs flawlessly. Don't forget these mods when migrating or setting up a new instance.
  
 + sudo a2enmod proxy_http
 + sudo a2enmod proxy
  
- --- //[[oemb1905@jonathanhaack.com|oemb1905]] 2019/12/17 23:16//+ --- //[[jonathan@haacksnetworking.org|oemb1905]] 2022/10/15 23:21//
computing/airsonic.1576649985.txt.gz · Last modified: 2019/12/18 06:19 by oemb1905