[HOW -TO] Install Subsonic 4.0.1 on FreeNAS 0.7.1

Tutorials, tips and tricks.

Moderator: moderators

[HOW -TO] Install Subsonic 4.0.1 on FreeNAS 0.7.1

Postby Talderon » Tue Aug 10, 2010 9:23 am

Installing SubSonic 4.0.1 onto FreeNAS 0.7.1

I found the initial guide on Subsonic.org forums, however, it was for an older version of FreeNAS and Subsonic, so I thought I would update things a little and see if this helps anyone out that is trying to get this going.

Few things to note:
1. I have hosted the files myself since this guide is meant for a specific versions of these packages. They were not easy to find so I wanted to make sure I could help out. I included MD5's for them files so you can check that they are untampered. :)
2. I cannot guarantee this will work with future versions of Subsonic or FreeNAS.
3. I offer no warranties on anything you do with this guide.
4. I have only done this on 32bit, have not tried, nor can I offer help on 64bit.
5. Credits: I used many scattered sources to get this all together and working, I can't recall all the sources, but THANKS FOR YOUR HELP!! Of course, thanks goes out to all the Dev's for Subsonic and FreeNAS. :)

PREPARATION

First of all, download all of the binaries that you will need:

Terminal app:

I suggest Putty, it's free, Google it.

OS:
FreeNAS 0.7.1 (32bit): http://sourceforge.net/projects/freenas ... o/download

APP:
Subsonic 4.0.1 Standalone: http://sourceforge.net/projects/subsoni ... z/download

Packages:
Go here: http://www.freebsdfoundation.org/downloads/java.shtml
--Download: Diablo Latte JRE 1.6.0-7 FreeBSD 7.x/i386 End-User 27M diablo-jre-freebsd7.i386.1.6.0.07.02.tbz

javavmwrapper-2.3.2: http://dl.dropbox.com/u/3963477/FreeNAS ... -2.3.2.tbz
MD5: e640b74fa891e1a77e339c87e3879b02

xextproto-7.0.2: http://dl.dropbox.com/u/3963477/FreeNAS ... -7.0.2.tbz
MD5: e2f6a3f9e4af171d827729ce0372ca46

xproto-7.0.10_1: http://dl.dropbox.com/u/3963477/FreeNAS ... 0.10_1.tbz
MD5: 6993357516d793e41eec42357ee4667c

xtrans-1.0.4: http://dl.dropbox.com/u/3963477/FreeNAS ... -1.0.4.tbz
MD5: 58e5d17f49f83a2aae2953696e8e0c80

INSTALLATION

*Ok, now that is all downloaded, you will need to burn the FreeNAS ISO to a CD.
*Boot up the CD
*Once you get to the "Console setup" page, choose option 9) Install/Upgrade to hard drive/flash device, etc.
*On the "Install" screen, choose option 3) Install 'full' OS on HDD + DATA + SWAP partition
*Select the Source CD drive (acd0 for example if you have one ATA CDROM drive).
*Select the Destination HDD that you want to install and boot FreeNAS from (ad0 for example if you want to install it on the master hard drive on the ATA channel 1).
--Personally, I chose to use a 2GB Partition for FreeNAS so I can make sure I have room to expand (2048MB for those that need to know). Other partitions I left Default.
*In both cases, once FreeNAS is installed, follow the instructions, remove the CD and when the menu comes up again
*Pree ESC or select 'Exit' and enter to exit to the main menu
*Select 7 to reboot the computer.

At this point, you should be going straight into the FreeNAS main screen.

You will need to note the Interface IP Address and make sure it is set up correctly for your network.

Now that you have this installed, you will want to enable SSH onto your server so you can open a terminal window and do your work there rather than from the GUI, which is, at best, not easy for this kind of work.

http://<your-freenas-server>/ in your browser. This is displayed on the main screen of your FreeNAS terminal. If you need more help about this, google it. :)

Mouse over Access and click on Users and add yourself as a user:

Options are self explainatory, but set these:

Shell: bash
Primary group: admin

Click Save

Mouse over Services then click on SSH

Setup with the following:

TCP Port: 22
Permit Root Login: Checked
Password Authentication: Checked

Click Save and Restart

Wait for reboot to complete.

Upload the files:

Mouse over Advanced then click Command

Click on "Choose File" button and upload the packages and the app (listed above)

They will be uploaded to the server in /var/tmp/

SSH to your server:

UserID: root
Passwd: {admin password which you set when setting up FreeNAS}

cd /var/tmp
ls -l (to verify the files are uploaded)

Type the following commands one at a time:

pkg_add -v -r xtrans-1.0.4.tbz
pkg_add -v -r xproto-7.0.10_1.tbz
pkg_add -v -r xextproto-7.0.2.tbz
pkg_add -v -r javavmwrapper-2.3.2.tbz

Once those are installed, install the JRE:

pkg_add -v diablo-jre-freebsd7.i386.1.6.0.07.02.tbz

Hit enter for defaults and to scroll through the License Agreement.

Type yes and hit enter when asked if you agree.

Type the following to prepare to install Subsonic:

cd /var
mkdir subsonic
cd subsonic
mkdir standalone
cd standalone

Copy the install files to the new folder

mv /var/tmp/subsonic-4.0.1-standalone.tar.gz /var/subsonic/standalone/subsonic-4.0.1-standalone.tar.gz

Unpack the file:

tar vxfz subsonic-4.0.1-standalone.tar.gz

This should unpack the files here (/var/subsonic/standalone).

Backup one directory:

cd ..

Create the Transcoder directory:

mkdir transcode

Install the trasncoder packages:

pkg_add -v -r mac
pkg_add -v -r lame
pkg_add -v -r flac

NOTE: If you get an error with the LAME package download/install, use one of the following:

pkg_add -r -v http://ftp.urc.ac.ru/pub/OS/FreeBSD/pac ... t/lame.tbz

or

pkg_add -r -v http://dl.dropbox.com/u/3963477/FreeNAS/lame.tbz
MD5: 9cddcbd38888647deb753993af306906

COPY (NOT move) them to the transcoder directory:

cp /usr/local/bin/lame /var/subsonic/transcode
cp /usr/local/bin/flac /var/subsonic/transcode
cp /usr/local/bin/mac /var/subsonic/transcode

Now to fix the startup script:

cd /var/subsonic/standalone
vi subsonic.sh

Here, you will want to delete or comment out the following lines:

cd $(dirname $0)
if [ -e /bin/readlink ] || [ -e /usr/bin/readlink ]; then
cd $(dirname $(readlink -f $0))
fi

You will in its place, add the following line:

cd `dirname $0`

Save and exit.

Start Subsonic on bootup:

In the FreeNAS web interface, go to System > Advanced > Command script and add the following "PostInit" script:

/var/subsonic/standalone/subsonic.sh

That's it! Done! Reboot to get it running and make sure it's all set.

Go to http://<your-freenas-server>:4040 to start using Subsonic.

Error logs are at:

/var/subsonic/subsonic_sh.log

I hope this helps!! Also, it's 2am here and I am waiting for UAT Testers to finish while I am writting this, so if there are any mistakes, mispellings or whatever, sorry about that, I'll try and edit this and keep it corrected.

Thanks again all!
Talderon
 
Posts: 6
Joined: Mon Aug 09, 2010 3:10 am

Postby japster » Sun Aug 15, 2010 12:13 pm

thanks, works great on 7.1 amd 64
Did just an upgrade from 3.8 to 4.1 had only to fix the start up script!
japster
 
Posts: 11
Joined: Sun Jun 13, 2010 9:01 pm

Re: [HOW -TO] Install Subsonic 4.0.1 on FreeNAS 0.7.1

Postby binzer » Wed Aug 18, 2010 1:18 am

Talderon wrote:Installing SubSonic 4.0.1 onto FreeNAS 0.7.1

INSTALLATION

Upload the files:

Mouse over Advanced then click Command

Click on "Choose File" button and upload the packages and the app (listed above)

They will be uploaded to the server in /var/tmp/


When I do this I get errors, sounds like it is out of space. ??

404 Request Entity Too Large

SSH to your server:

UserID: root
Passwd: {admin password which you set when setting up FreeNAS}

cd /var/tmp
ls -l (to verify the files are uploaded)

Type the following commands one at a time:

pkg_add -v -r xtrans-1.0.4.tbz
pkg_add -v -r xproto-7.0.10_1.tbz
pkg_add -v -r xextproto-7.0.2.tbz
pkg_add -v -r javavmwrapper-2.3.2.tbz


for the couple of packages I did manage to upload I get the following error:
unable to fetch (package).

I am not sure why it is trying to download them when they are in the directory, I even tried with a ./ in front of the package name. ??

System is a P4 2.4G w/512m ram SHUTTLE system, boot is from a 4g CF card, music files are on an 80G sata as /dev/ad4.

Thanks, Mike.
binzer
 
Posts: 2
Joined: Wed Aug 18, 2010 1:06 am

Re: [HOW -TO] Install Subsonic 4.0.1 on FreeNAS 0.7.1

Postby Talderon » Wed Aug 18, 2010 8:23 pm

binzer wrote:
Talderon wrote:Installing SubSonic 4.0.1 onto FreeNAS 0.7.1

INSTALLATION

Upload the files:

Mouse over Advanced then click Command

Click on "Choose File" button and upload the packages and the app (listed above)

They will be uploaded to the server in /var/tmp/


When I do this I get errors, sounds like it is out of space. ??

404 Request Entity Too Large

SSH to your server:

UserID: root
Passwd: {admin password which you set when setting up FreeNAS}

cd /var/tmp
ls -l (to verify the files are uploaded)

Type the following commands one at a time:

pkg_add -v -r xtrans-1.0.4.tbz
pkg_add -v -r xproto-7.0.10_1.tbz
pkg_add -v -r xextproto-7.0.2.tbz
pkg_add -v -r javavmwrapper-2.3.2.tbz


for the couple of packages I did manage to upload I get the following error:
unable to fetch (package).

I am not sure why it is trying to download them when they are in the directory, I even tried with a ./ in front of the package name. ??

System is a P4 2.4G w/512m ram SHUTTLE system, boot is from a 4g CF card, music files are on an 80G sata as /dev/ad4.

Thanks, Mike.


How big did you make the installation partition?

Run:

df -h

and paste contents here.

Make sure you are in the directory that the packages are in when trying to run the pkg_add command. You should be in /var/tmp when running them. Again, make sure you have space as needed and logged in as ROOT.
|Talderon|

SubSonic 4.0.1
FreeNAS 0.7.1

How-To for above install
Talderon
 
Posts: 6
Joined: Mon Aug 09, 2010 3:10 am

Re: [HOW -TO] Install Subsonic 4.0.1 on FreeNAS 0.7.1

Postby binzer » Thu Aug 19, 2010 3:17 pm


How big did you make the installation partition?

Run:

df -h

and paste contents here.

Make sure you are in the directory that the packages are in when trying to run the pkg_add command. You should be in /var/tmp when running them. Again, make sure you have space as needed and logged in as ROOT.


$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/md0 174M 165M 9.6M 94% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
/dev/ad4p1 74G 8.6G 60G 13% /mnt/music
/dev/md1 31M 1.1M 27M 4% /var
/dev/ad0a 69M 63M 6.7M 90% /cf

This is a standard install, both 0.7.1 and 0.7.2 do the same thing.
I did not specify any sizes, done by the install, unless I have to do it some other way.
I find no files in /var/tmp only a directory /ftmp that is empty.
My uploaded files were found in /tmp, the three that actually did upload.

If I try to install the packages from the console I get the same thing, it tries to go online to get the package and fails.

I even tried a chmod 777 on one package and it still tried to go outside to get it.

Tnx,Mike.
binzer
 
Posts: 2
Joined: Wed Aug 18, 2010 1:06 am

Postby Talderon » Thu Aug 19, 2010 9:13 pm

Code: Select all
/dev/md0 174M 165M 9.6M 94% /


You need to re-install and allocate additional space to the root partition. You only have 9.6m free and need more space.

I allocated 2GB for this purpose. Try that and see how it works.

Also, you need to make sure you are logged in as the ROOT user.

I just did another install on a test server and cannot reproduce this issue when following my tutorial. I also set this up for my brother at his house, again, no issues.
|Talderon|

SubSonic 4.0.1
FreeNAS 0.7.1

How-To for above install
Talderon
 
Posts: 6
Joined: Mon Aug 09, 2010 3:10 am

Postby whackly » Tue Aug 31, 2010 1:53 pm

I was following these instructions here and everything was going well except the upload portion actually put the files in /tmp/ not /var/tmp/, which is no big deal. I don't know if it's relevant or not because I don't really know what I'm doing.

All is working fine until I enter
pkg_add -v diablo-jre-freebsd7.i386.1.6.0.07.02.tbz

that command returns

pkg_add: make_playpen: can't mktemp '/var/tmp/instmp.gp0lck' (where the .gp0lck is actually a seemingly random string that's different each time)

and I don't understand what that means or why it's happening.

Can anyone hook me up with a noob-assist?

*** just discovered***
apparently the previous pkg_adds failed as well. Here's an example:

[whackly@freenas /tmp]$ pkg_add -v -r xtrans-1.0.4.tbz
scheme: [ftp]
user: []
password: []
host: [ftp.freebsd.org]
port: [0]
document: [/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/xtrans-1.0.4.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS whackly@freenas.local
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/i386/packages-7.2-release/Latest
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
setting passive mode
>>> PASV
<<< 227 Entering Passive Mode (204,152,184,73,32,96).
opening data connection
initiating transfer
>>> RETR xtrans-1.0.4.tbz
<<< 550 Failed to open file.
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports ... -1.0.4.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/xtrans-1.0.4.tbz' by URL
pkg_add: 1 package addition(s) failed
whackly
 
Posts: 7
Joined: Tue Aug 31, 2010 1:49 pm

Postby whackly » Wed Sep 01, 2010 1:03 am

I put some time and thought in to this and gave it a 2nd try without being such an idiot. It appeared as if I had navigated the instructions the 2nd time around and all was well. However, after having rebooted the freenas box, I couldn't get to the subsonic web gui. I went straight to the error log and found this:

Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

what did i screw up? I'm clueless. If I try any of the package adds again they fail (and it seems to be because they are already installed). If I run them without the "-r" I get the message "package (insert package here) or its older version is already installed"


*update 9.2.10* i just removed and deleted everything and started over. i will say that when i try to run the pkg_add for xtrans, xproto, and xextproto they fail (unable to ftp-which is weird since the file is downloaded and in the directory) but if i use the package add function in freenas they go through just fine.

alas, it still does not work and i still get the libjava.so and runtime environment errors in the log.
whackly
 
Posts: 7
Joined: Tue Aug 31, 2010 1:49 pm

Postby whackly » Thu Sep 09, 2010 3:17 am

some tips that worked for me

1 the files upload to /tmp not /var/tmp. use the freenas file manager to move them once they're uploaded

2. leave out the "-r" for xtrans xproto xextproto and javavmwrapper

3. http://ftp.urc.ac.ru/pub/OS/FreeBSD/packages-7/Latest/ use this link to find the lame mac and flac.tbz files and the dependencies they will require to be installed (you'll see them listed if the install fails) and upload them and install them the same way you did xtrans and the rest.

4. to fix the startup script just go to the file editor in freenas and open /var/subsonic/standalone/subsonic.sh, make the change, and save. much easier

Hope that helps.
whackly
 
Posts: 7
Joined: Tue Aug 31, 2010 1:49 pm

Postby markheppner » Sun Nov 21, 2010 8:16 am

when you add the package, leave off the -r flag. with it on, it tells the command to look in the remote site, the freebsd ftp site, and without it, it will use the local package in the current directory.

also, the packages from freebsd work fine. just use the command:
pkg_add -r xtrans xproto xextproto javavmwrapper
and it will install all the packages from the freebsd ftp server, no need to compile anything from source. it worked for you anyways, since you were using the remote flag to install these packages.
markheppner
 
Posts: 9
Joined: Fri Aug 28, 2009 3:58 pm
Location: Ohio

Postby BigLa » Fri Dec 03, 2010 4:56 pm

This tutorial was excellent. Was up and running in no time. The advice on removing -r was also a big help.
BigLa
 
Posts: 9
Joined: Fri Dec 03, 2010 4:53 pm

Not working

Postby Rauna » Sat Dec 04, 2010 9:25 am

Hello.

I did exactly as you explained.
But Subsonic seems to not start.
I only get a message in the browser, can not connect.
How can I confirm that Subsonic has started?
I have Subsonic 4.2 and freenas 0.7.2.5543

Thank you very much
Kenneth
Rauna
 
Posts: 5
Joined: Sat Dec 04, 2010 9:17 am

Postby 3R3 » Tue Jan 18, 2011 5:54 pm

Hi thanks for the guide!
One thing, you might want to clarify
Once those are installed, install the JRE:

pkg_add -v diablo-jre-freebsd7.i386.1.6.0.07.02.tbz

for windows users, eg. "to install the JRE, type:" or something...or you might not seeing as you choose to force the use of "vi", the notoriously hardest-to-use editor ever ;)
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby Harani » Sun Jan 23, 2011 12:50 pm

i couldn't get this to work using the -r switch i had to use local packages.

this worked for al the packages except xproto which needs a dependency

freenas:/var/tmp# pkg_add -v ./xproto-7.0.10_1.tbz
Requested space: 263K bytes, free space: 785M bytes in /var/tmp/instmp.9HInLx
Package 'xproto-7.0.10_1' depends on 'pkg-config-0.23_1' with 'devel/pkg-config' origin.
pkg_add: could not find package pkg-config-0.23_1 !
pkg_add: 1 package addition(s) failed



when i run it (or any of them) with the -r flag i get

freenas:/var/tmp# pkg_add -v -r ./xproto-7.0.10_1.tbz
scheme: [ftp]
user: []
password: []
host: [ftp.freebsd.org]
port: [0]
document: [/pub/FreeBSD/ports/i386/packages-8-stable/Latest/./xproto-7.0.10_1.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS root@freenas.dodekanese
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/i386/packages-8-stable/Latest/.
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
setting passive mode
>>> PASV
<<< 227 Entering Passive Mode (204,152,184,73,37,93)
opening data connection
initiating transfer
>>> RETR xproto-7.0.10_1.tbz
<<< 550 Failed to open file.
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports ... 0.10_1.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/./xproto-7.0.10_1.tbz' by URL
pkg_add: 1 package addition(s) failed


can anyone help me out with this please ?
Harani
 
Posts: 3
Joined: Sun Jan 23, 2011 12:24 pm

Postby Harani » Sun Jan 23, 2011 9:44 pm

think i've sorted this.

to pull packages from the "latest" repository it appears you only specify the filename and not the version
Harani
 
Posts: 3
Joined: Sun Jan 23, 2011 12:24 pm

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests