How to install Subsonic on FreeNAS

Tutorials, tips and tricks.

Moderator: moderators

How to install Subsonic on FreeNAS

Postby sindre_mehus » Tue Jan 13, 2009 5:49 pm

This tutorial explains how to install Subsonic on the popular FreeNAS server.

The following was done with Subsonic 3.6 and FreeNAS 0.69. Note that a "full", not "embedded" FreeNAS installation is required. Make sure to allocate enough disk space on the OS partition. Java and Subsonic requires at least 150MB.

In terms of hardware requirements, you probably need at least 750MHz CPU and 180MB RAM.

Step 1: Download Java JRE (or JDK) package from http://www.freebsdfoundation.org/downloads/java.shtml

Step 2: Install dependent packages first:
Code: Select all
$ pkg_add -v -r xtrans
$ pkg_add -v -r xproto
$ pkg_add -v -r xextproto
$ pkg_add -v -r javavmwrapper

Step 3: Install the JRE (the .tbz file is the one you downloaded in step 1)
Code: Select all
$ pkg_add -v diablo-jre-freebsd6.i386.1.6.0.07.02.tbz

Step 4: Download Subsonic standalone version and install it in /var/subsonic/standalone, as described here.

Step 5: In the FreeNAS web interface, go to System > Advanced > Command script and add the following "PostInit" script:
Code: Select all
/var/subsonic/standalone/subsonic.sh

Step 6: Reboot FreeNAS, and go to http://<your-freenas-server>:8080 to start using Subsonic.

Your comments are welcome!
Last edited by sindre_mehus on Thu Jan 29, 2009 9:20 am, edited 1 time in total.
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby AndyD » Thu Jan 29, 2009 1:17 am

Nice one Sindre.
chmod +x subsonic.sh (because I copied from windows probably)

Subsonic is asking for LAME...I can't find the LAME package for FreeBSD....can you help?
AndyD
 
Posts: 5
Joined: Mon Oct 06, 2008 10:18 pm

Postby AndyD » Thu Jan 29, 2009 9:10 am

Oh..I knew there was something I forgot....

pkg_add -v -r javawmwrapper

doesn't work, I downloaded the package and did it as:
pkg_add -v javawmwrapper.tgz (or whatever it was called.

Also Subsonic doesn't auto start, I've just chmod 777 subsonic.sh to see if that works.
AndyD
 
Posts: 5
Joined: Mon Oct 06, 2008 10:18 pm

Postby sindre_mehus » Thu Jan 29, 2009 9:22 am

AndyD wrote:pkg_add -v -r javawmwrapper
doesn't work


Oops, my mistake - it should be "javavmwrapper", not "javawmwrapper".

(I've corrected the typo in the original post).

Thanks for reporting it!
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby heinakenka » Sun Mar 01, 2009 4:22 am

Hi,

Just some clarifying questions:
- which version of Java is right for latest FreeNAS?
- I use windows pc for browsing so what how do I get the Java to the FreeNAS machine? Copy of cource but which directory etc...?
heinakenka
 
Posts: 1
Joined: Sun Mar 01, 2009 4:15 am

AVI,WMV, ASF streaming

Postby jingy » Sat Apr 25, 2009 10:02 pm

Hi! Subsonic is awesome! Does anybody know or can give a step-by-step procedure on how to streaming video formats like avi, asf, wmv etc using freenas server? I'm a total newbie with this transcoding thing but willing to learn. Also, I know my subsonic works beacuse I can stream my mp3s.

Thanks a lot!
jingy
 
Posts: 2
Joined: Sat Apr 25, 2009 4:46 am

Postby Kryspy » Sat Jun 06, 2009 11:19 pm

Hi,

What is the reason as to why it cannot run on a embedded install ??

Thanks

Kryspy
Kryspy
 
Posts: 1
Joined: Sat Jun 06, 2009 11:18 pm

Postby rich0805 » Wed Jun 17, 2009 8:36 pm

I am I missing something here?

Step one says download
Step two says install
Step three says the file downloaded in one

So where do I get the files I need to install in two?

Richard
rich0805
 
Posts: 11
Joined: Wed Jun 17, 2009 8:29 pm
Location: United Kingdom

Postby sgx1 » Thu Jun 18, 2009 10:11 pm

Using the FreeNAS console, just type in those commands (omitting the $) to download and install the packages from the FreeBSD repository.

pkg_add -v -r xtrans
pkg_add -v -r xproto
pkg_add -v -r xextproto
pkg_add -v -r javavmwrapper
sgx1
 
Posts: 19
Joined: Wed Apr 29, 2009 11:40 pm

Postby rich0805 » Fri Jun 19, 2009 8:41 am

Thanks sgx1, I'll give that ago...This is all pretty new to me, I'm more used to DOS and Windows :oops:

I installed FreeNAS months ago and it has worked perfectly ever since, this will be the first time I have had to go back and do anything!
rich0805
 
Posts: 11
Joined: Wed Jun 17, 2009 8:29 pm
Location: United Kingdom

Postby censu » Sat Jul 25, 2009 7:14 pm

Possible noob question here, but everytime I try to complete Step 3 (installing the Java Runtime), the install begins and runs for about 30 seconds, then gets stuck in a loop prompting me for a yes or no answer to the Java license agreement. I am trying to perform the install using the Advance/Execute command interface in FreeNAS. I have uploaded the JRE .tbz to an FTP site and I am running the code "pkg_add -v <ftp address> diablo-jre-freebsd6.i386.1.6.0.07.02.tbz".

If I am going about this in the completely wrong manner, could someone please post some step by step instructions (written for an idiot :roll: ) on how to perform the installation?
censu
 
Posts: 7
Joined: Sat Jul 25, 2009 7:07 pm

Postby sgx1 » Sun Jul 26, 2009 5:42 pm

The Java installation cannot be done through the web configuration page. It just loops, as you've seen. There may be a way to pipe in the "y", but I've not tested.

Instead, at the FreeNAS computer, you go to the Console option and type in the same pkg_add command, which will go through the same process, but will allow you to enter a response at the prompt.

Alternatively, you can enable SSH in the FreeNAS services, and you can then use TelNet (Windows: Start > Run > CMD > "TelNet <ipaddress> 22") to get to the command line as well. Then, you can run the same pkg_add command.

I hope this helps.

Also, if you're using the newest FreeNAS based off of BSD 7, you can use the JRE for BSD 7 instead.
sgx1
 
Posts: 19
Joined: Wed Apr 29, 2009 11:40 pm

Postby censu » Mon Jul 27, 2009 5:14 am

Well I know I was doing something wrong! Thanks to you, I am now up and running and loving it. Thanks again!
censu
 
Posts: 7
Joined: Sat Jul 25, 2009 7:07 pm

Postby morpheus214 » Mon Jul 27, 2009 3:01 pm

It doesnt' work for me.

I tried to install it on FreeNAS v. 0.69.2. I installed the packages needed for java as well as diablo-jre-freebsd6.i386.1.6.0.07.02.tbz. Then i created a folder /var/subsonic/standalone/ and copied the contents from the *.tar.gz into the folder. I set the path for the *.sh file and restarted.

When i opened <myfreenas>:8080 in the browser, nothing happened, so i started the sh-file again through the command --> again nothing.

So i opened the subsonic log:

Code: Select all
118 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@34a1fc: display name [org.springframework.context.support.ClassPathXmlApplicationContext@34a1fc]; startup date [Mon Jul 27 14:21:21 GMT 2009]; root of context hierarchy
365 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [applicationContext-deployer.xml]
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from class path resource [applicationContext-deployer.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:369)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:158)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:184)
   at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
   at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
   at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97)
   at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
   at net.sourceforge.subsonic.booter.Main.<init>(Main.java:16)
   at net.sourceforge.subsonic.booter.Main.main(Main.java:21)
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
   at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:78)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:361)


Does this mean i have the wrong java version? I have no idea what to do now... Do i have to deinstall(how?) java and install another version?

Please help me :?
morpheus214
 
Posts: 8
Joined: Mon Jul 27, 2009 2:50 pm

Postby sgx1 » Mon Jul 27, 2009 4:04 pm

That looks similar to the error message I was getting with the Subsonic 3.7 beta.

Which Subsonic package are you installing?
sgx1
 
Posts: 19
Joined: Wed Apr 29, 2009 11:40 pm

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests