How To Install MusicCabinet on FreeNas 8.3.1 release

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

How To Install MusicCabinet on FreeNas 8.3.1 release

Postby ForSSUx » Sat Mar 30, 2013 9:49 am

Hi There,

I'm working as a sound engineer in the Belgian army...We have our own communications department.
At the video department we have 5 Avid stations that uses "Library Music" to enhance the viewing experience.

Our "Library Music" publisher mostly visit us once a year to upgrade ( add ) music.
We have several of these fine publisher ...www.sonofind.com..is one Universal is another.
They tend to do of course things a little different.
Anyway enough with the chit chat.

Tech Spec
Old Avid Unity chassis HP 8200xw Motherboard with 8GB ram and 16 disk each 160 GB running a zfs pool
I opted for FreeNas 8.3.1 release. We have over 500k of songs

I have installed subsonic on it from here http://forums.freenas.org/showthread.ph ... nic-Plugin from Joshua Parker thanks for this.
And learned a lot from here http://www.parmeter.net/ben/2011/02/02/ ... tructions/
After running this I quickly learned that although a great program, I needed tag search and here begins the MusicCabinet story

1) Requierments:
a) a jail setup as described here:
http://doc.freenas.org/index.php/Plugins

b) DNS check like the one from google 8.8.8.8
In the main one can do it via the webpage "Horizontal Network tab and in Global Configuration choose nameserver 1 and fill 8.8.8.8 and/or nameserver 2 8.8.4.4
freenasDNS.PNG


c) a mount point for your media
freenasMountpoints.PNG



No Original subsonic is required to run MusicCabinet !!!!!!

2) Remove or make the jail
a) create two datasets in your ZFS pool
freenaspool.PNG


b) upload the FreeNAS-8.3.1-RELEASE-x64.Plugins_Jail.pbi
freenaspluginssettings.PNG


c) make sure the plugin service is active
freenqsservices.PNG


now to be on the safe side ...the web page doesn't always tells the truth.
Go to the shell and type

[root@freenas ~]# jls
JID IP Address Hostname Path
1 - software /mnt/DGCOM-Music/jail/software
voila the jail is running and has a JIS of 1

d) make sure you can search the jail
[root@freenas ~]#jexec 1 /bin/tcsh
software# /usr/libexec/locate.updatedb

3) Installing MusicCabinet in the jail.
a) open the jail

[root@freenas ~]# jls
JID IP Address Hostname Path
1 - software /mnt/DGCOM-Music/jail/software
voila the jail is running and has a JIS of 1 your milage may vary on the JID and software

okay open the jail with:
[root@freenas ~]# jexec 1 /bin/tcsh
software#

The software# is the name of my jail and may be different for you

b) install dependencies in the jail

MusicCabinet needs at least openjdk7 with this you'll have the gui and all but no metadatascanning it's like the original subsonic ...kind off
MusicCabinet should best be installed with postgresql 9 above, then you'll have it as intended.

So normally do a
software#
Code: Select all
pkg_add -v -r openjdk7
pkg_add -v -r postgresql91-server
pkg_add -v -r postgresql91-contrib


Add the following line to /etc/rc.conf to enable postgresql
postgresql_enable="YES"
Code: Select all
echo postgresql_enable="YES" > /etc/rc.conf


Code: Select all
/usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start


Configure PostgreSQL to listen for database connections on all system IP addresses by changing the following line in /usr/local/pgsql/data/postgresql.conf

#listen_addresses = 'localhost' to listen_addresses = '*'
software# su pgsql
$ createuser -sdrP postgres
Enter password for new role: mypassword
Enter it again: mypassword
$exit
software#
c) resolve troubles finding packages

If it doesn't find you'll be able to change the place where it looks per default, the -r let it go to a standard location if you now a other place you can set it to look there
choose 1 of three that's right for your enverinement
Code: Select all
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/"
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/ia64/packages-9-current/All/"
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-current/All/"


software#
Code: Select all
pkg_add -v -r openjdk-7.2.13.tbz


or if you downloaded with fillezilla at home place it somwhere in your jail and do
Code: Select all
pkg_add -v /media/openjdk-7.2.13.tbz


Still difficult to get the packages?
software# pkg_add -r -v openjdk7
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/po...t/openjdk7.tbz... Done.
Package dependency openjdk7 for ftp://ftp.freebsd.org/pub/FreeBSD/po...t/openjdk7.tbz not found!
etc....

Try to ping google and do a
Code: Select all
ping google.com
ping 8.8.8.8
result not okay?

if above doesn't work you'll never find the packages..

I had this at my work we have a public ipadress that starts at 10.29.66.*** this range has ftp
But the working server needs to be running on another subnet witch starts at 10.120.17.*** this range has no ftp
So I needed to switch between them and forgot to change the Ipadress of the jail ..
Of course the packages weren't found

exit the jail...
Code: Select all
exit


do you have a nameserver in your /etc/resolv.conf?
Code: Select all
vi /etc/resolv.conf

some keys for vi "esc" "i" "d" "r" i=insert r=replace d=delete alter between them with the esc key
to save "esc" ":wq!" :wq! is entered at the prompt
to quit without saving ":q!"
so change your /etc/resolv.conf and add nameserver 8.8.8.8 or at the prompt you can:
echo nameserver 8.8.8.8 > /etc/resolv.conf the > pipes the output to a file instead of standard to the screen..

You can also use the gui tab network fill nameserver 1 and IPv4 default gateway !!!

You can also copy the files onto the nas with all its dependencies aargh you're in for a ..
The -r let it go to a standard location if you know another place

choose 1 of 3 that's right for your enverinement
Code: Select all
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/"
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/ia64/packages-9-current/All/"
software# setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-current/All/"

software#
Code: Select all
pkg_add -v -r openjdk7.tbz


or if you downloaded with fillezilla at home place it somwhere in your jail and do
Code: Select all
pkg_add -v /media/openjdk7.2.13.tbz
notice that the -r is not used



c) installing MusicCabinet

download the stand allone version here http://dilerium.se/musiccabinet/subsonic-installer-standalone.zip unzip it and rename the folder to standalone and move it to your share, mine is /mnt/DGCOM-Music
Code: Select all
software# mkdir /var/subsonic
software# cp r /mnt/DGCOM-Music/standalone /var/subsonic
chmod 777 /var/subsonic/standalone/*.*



d) adapt some variables here and there

software# vi /etc/hosts
change this line 127.0.0.1 localhost localhost.my.domain
to 127.0.0.1 localhost localhost.my.domain software

software# vi /var/subsonic/standalone/subsonic.sh
maybe not needed but change
cd $(dirname $0)
if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
cd $(dirname $(readlink $0))
fi

to
cd /var/subsonic/standalone
#if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
#cd $(dirname $(readlink $0))
#fi


SUBSONIC_HOME=/var/subsonic
SUBSONIC_HOST=192.168.1.66 # my jail has ip 192.168.1.66 yours?
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=450 # with over +500k of songs I had a little more then 2GB ram necessary
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/media
SUBSONIC_DEFAULT_PODCAST_FOLDER=/media
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/media

Make sure of the java path, change underlying in the script:

# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=java
if [ -e "${JAVA_HOME}" ]
then
JAVA=${JAVA_HOME}/bin/java
fi


to
# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=/usr/local/openjdk7/bin/java



4) Adapt startup script

echo postgresql_enable="YES" > /etc/rc.conf
subsonic startup script somebody?
http://www.freebsddiary.org/startup.php maybe?

5) Test your MusicCabinet

[root@freenas ~]# jexec 1 /bin/tcsh
software# cd /var/subsonic/standalone
software# ./subsonic.sh
Started Subsonic [PID 5613, /var/subsonic/subsonic_sh.log]

write down the pid number 5613

6) Transcoding

I didn't need this so this is a 1/1 copy of http://www.parmeter.net/ben/2011/02/02/installing-subsonic-on-freenas-and-bonus-upgrade-instructions/

mkdir /var/subsonic/transcode
cp /usr/local/bin/lame /var/subsonic/transcode/
cp /usr/local/bin/flac /var/subsonic/transcode/
cp /usr/local/bin/ffmpeg /var/subsonic/transcode/

Configure your transcoder settings. In the Subsonic web interface go to “Settings > Transcoding”.

In this example, I’ve set up FLAC to transcode to WAV, then to MP3. On the line reads “flac > mp3″ modify the following:

Step 1 = flac -c -s -d %s
Step 2 = lame -b 192 – -


Kind Regards and thanks for reading
Guy Forssman
Last edited by ForSSUx on Thu Apr 25, 2013 7:59 pm, edited 7 times in total.
ForSSUx
 
Posts: 24
Joined: Thu Mar 21, 2013 7:12 pm

Re: HOWTO MusicCabinet on FreeNas 8.3.1 release

Postby hakko » Tue Apr 02, 2013 8:17 pm

This is a very extensive write-up, thanks!

The only thing I'd like to add here is that it's not necessary to install Subsonic before running the software that comes in the stand-alone installer for MusicCabinet. The stand-alone zip contains two binaries (a .war and a .jar file) and scripts to start the server (subsonic.sh and subsonic.bat). To get your server running, you just need to make sure the scripts look fine (that you have Java 7 on your path etc) and then chmod and run the script. That'll open up a server listening for connections on the default port (4040).

Then you might want to fiddle a bit to have the server auto-started (well, some people want). That totally depends on your OS.

Anyway that's just a minor detail but I might as well explain it as I've seen a few people start by installing Subsonic!

Regards
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: HOWTO MusicCabinet on FreeNas 8.3.1 release

Postby ForSSUx » Tue Apr 02, 2013 8:21 pm

Hi Hakko,

Just learned this and I will adapt the Howto...

Just Split them into installing subsonic and installing MusicCabinet

Thanks for replying
Guy Forssman
ForSSUx
 
Posts: 24
Joined: Thu Mar 21, 2013 7:12 pm

Re: HOWTO MusicCabinet on FreeNas 8.3.1 release

Postby hakko » Tue Apr 02, 2013 8:24 pm

I also made a note about this since it seems to be a common mis-understanding (which I guess I caused myself):

http://dilerium.se/musiccabinet/#details
The MusicCabinet installers come with everything needed to replace your current server. There's no need to install Subsonic if you don't have it running already. But if you happen to use it, your configuration and user settings will be picked up and transferred into MusicCabinet on installation. Please note that for security reasons, MusicCabinet stores passwords of users as salted hash sums instead of clear-text as Subsonic does. Your settings directory (C:\Subsonic on Windows) will be updated with no option of going back unless you make your own backup.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: How To Install MusicCabinet on FreeNas 8.3.1 release

Postby ForSSUx » Tue Apr 02, 2013 9:11 pm

Hi,

I just adapted the howto but still I'm looking to autostart Musiccabinet I found this but it doesn't aply anymore I guess

Step 7: In the FreeNAS web interface, go to System > Advanced > Command script and add the following “PostInit” script:

/var/subsonic/standalone/subsonic.sh


Do you have any thoughts?

Kind Regards
Guy Forssman
ForSSUx
 
Posts: 24
Joined: Thu Mar 21, 2013 7:12 pm

Re: How To Install MusicCabinet on FreeNas 8.3.1 release

Postby hakko » Tue Apr 02, 2013 9:16 pm

That should be fine since it's the location from your step #5:

software# cd /var/subsonic/standalone
software# ./subsonic.sh

running the subsonic.sh script is what starts your server, so you just want that script to run automatically.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: How To Install MusicCabinet on FreeNas 8.3.1 release

Postby ForSSUx » Tue Apr 02, 2013 9:23 pm

hakko wrote:That should be fine since it's the location from your step #5:

software# cd /var/subsonic/standalone
software# ./subsonic.sh

running the subsonic.sh script is what starts your server, so you just want that script to run automatically.


yeah but that's the question I can start it alright but where do I put it

It's the automatically thing that i don't get wright now


kind regards
Guy Forssman
ForSSUx
 
Posts: 24
Joined: Thu Mar 21, 2013 7:12 pm


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 2 guests