How to install Subsonic on Ubuntu

Tutorials, tips and tricks.

Moderator: moderators

thanks for your help but still I can't get through

Postby ferreol » Wed Sep 09, 2009 9:39 pm

Hello and thanks for your kind help .

However it keeps continuing to redirect me to root volder of my virtualhost .

I will try to explain you the steps of my installation .

I download the tar.gz file 3.7 and copy it to /var/subsonic/standalone

then I edit my subsonic.sh like this :

SUBSONIC_HOME=/var/www/subsonic
SUBSONIC_HOST=my.domain.com
SUBSONIC_PORT=80
SUBSONIC_CONTEXT_PATH=/ # note that I have also tried /subsonic
SUBSONIC_MAX_MEMORY=300 # I have changed to increase value
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/www/file/sounds
SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists

Then I run the script it works as it write some files and index in /var/www/subsonic

but then localhost redirect me to my home directory ( /var/www/subsonic) root of my virtualhost . (Note that I have also try by pointing the domain name to /var/subsonic & /var/subsonic/standalone

my virtualhost work as the two other servers are fonctionnals , my site is available as my.domain.com works too

My Java packges installed :

sun-java6-jre & jdk , sun-java6-plugin, sun-java6-bin , openjdk6jre


I don't what to do anymore .

I installed it some days ago and register a fake domain maybee this can stop my web app to pop up when I try to reach the configuration and login page ( http://my.domain.com ) ?

thanks in advance for any help .
ferreol
 
Posts: 5
Joined: Tue Sep 08, 2009 10:40 pm

Postby jigsaw » Fri Sep 11, 2009 5:53 am

Hi ferreol

First of you need to set the HOME-variable correctly:
SUBSONIC_HOME=/var/subsonic/standalone

If you want it to be located at /var/www/subsonic you need to move the tar.gz there and untar it at that location.

Does subsonic start fine when you init the subsonic.sh? Does localhost:8080/ send you to subsonic?
Currently without Subsonic due to hardware failure :(
User avatar
jigsaw
 
Posts: 242
Joined: Sat Oct 13, 2007 12:01 pm
Location: Stavanger, Norway

Hello still not fixed

Postby ferreol » Sun Sep 13, 2009 2:16 pm

Hey thanks again for your reply .

I did exatly what you said now and I still cannot get the subsonic page when I try to connect to localhost or mydomain.com defined in the subsonic.sh .

Instead of getting the Subsonic page I get an ftp page showing me the content of the Standalone folder in var/www/subsonic/standalone

I cannot understand why .

DO you have any other ideas ?
ferreol
 
Posts: 5
Joined: Tue Sep 08, 2009 10:40 pm

WORKING NOW

Postby ferreol » Sun Sep 13, 2009 2:43 pm

Hey all

It's working now nicely I have reinstalled using the WAR file and the method described at this link :

http://thismightbehelpful.blogspot.com/ ... e-and.html

Thanks again for your help .

One more question now to reach subsonic from my domain I have to type :

http://my-domain.com/subsonic:8180

Isn't it a way to ask subsonic to be reached by http://my-domain.com

Thanks in advance.
ferreol
 
Posts: 5
Joined: Tue Sep 08, 2009 10:40 pm

Re: WORKING NOW

Postby jigsaw » Sun Sep 13, 2009 7:39 pm

ferreol wrote:Isn't it a way to ask subsonic to be reached by http://my-domain.com

Glad to hear you got it up and running.
To do what you ask next just follow the tutorial from organon on Integrating Subsonic into existing Apache Web Space.
Currently without Subsonic due to hardware failure :(
User avatar
jigsaw
 
Posts: 242
Joined: Sat Oct 13, 2007 12:01 pm
Location: Stavanger, Norway

Debian init.d script

Postby lavamind » Sun Sep 27, 2009 11:55 pm

Hello, here is my Debian-flavored initscript for Subsonic standalone, based on the other scripts in this thread :

Code: Select all
#!/bin/sh
#
# /etc/init.d/subsonic
#
# Description: Linux startup-script for Subsonic standalone
#

[ ! -d /usr/bin ] && exit

PATH="$PATH:/bin:/usr/bin"
export PATH

USER=subsonic
SERVICENAME="Subsonic Media Streamer"
SUBSONIC_HOME="/var/subsonic/"
PIDFILE="$SUBSONIC_HOME/standalone/subsonic.pid"
PROG="$SUBSONIC_HOME/standalone/subsonic.sh"

test -x $PROG || exit 0

# Functions for starting and stopping subsonic
start() {
        if [ $RETVAL = 1 ]; then
            echo "Will cleanup and try to start.."
            rm -f $PIDFILE
        fi

        echo -n "Starting $SERVICENAME "
        # Start subsonic
        start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER --exec $PROG -- --pidfile=$PIDFILE --home=$SUBSONIC_HOME
   RETVAL=$?
        echo
        return $RETVAL
}
stop() {
        echo -n "Stopping $SERVICENAME "
        start-stop-daemon --stop --quiet --pidfile $PIDFILE
   RETVAL=$?
        rm -f $PIDFILE
        echo
        return $RETVAL
}
status() {
        if [ -r $PIDFILE ]; then
            check_pid
            if [ $RETVAL = 0 ]; then
                echo -n "$SERVICENAME is running"
            else
                echo -n "Pidfile found, but subsys is dead"
            fi
        else
            echo -n "$SERVICENAME is not running"
        fi
        echo
        return $RETVAL
}

check_pid() {
        RETVAL=0
        if [ -r $PIDFILE ]; then
            PID=`cat $PIDFILE`
            PS_PID=`ps -u $USER -f | grep $PID | grep subsonic-booter-jar-with-dependencies.jar | awk '{print $2 }'`
            [ ! $PS_PID ] && RETVAL=1
        fi
        return $RETVAL
}

RETVAL=0
# See how we were called.
case "$1" in
  start)
        if [ -r $PIDFILE ]; then
            status
            [ $RETVAL = 1 ] && start
        else
            start
        fi
        ;;
  stop)
        if [ -r $PIDFILE ]; then
            stop
        else
            status
        fi
        ;;
  status)
        status
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo "Usage: subsonic {start|stop|status|restart}"
        exit 1
esac
exit $RETVAL


As you can see it's missing the init info headers, though...
lavamind
 
Posts: 6
Joined: Sun Sep 27, 2009 11:45 pm

Postby 3R3 » Wed Oct 21, 2009 10:08 pm

is it really the only way to start the "subsonic.sh" via "sudo"? it gives me the creeps, but it also seems to be the only way it works (in ubuntu jaunty), I tried every other way and am actually no linux noob (just an interested layman ^^). I ran it in xp before, and i am wondering why it has to have root privileges.

anyone can enlighten me?
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby lavamind » Sat Oct 24, 2009 9:02 pm

3R3 wrote:is it really the only way to start the "subsonic.sh" via "sudo"? it gives me the creeps, but it also seems to be the only way it works (in ubuntu jaunty)

Running any network-facing application like Subsonic with root privileges is a really bad idea. This means that any security flaw in Subsonic could essentially compromise the whole system it's running on.

Hopefully Subsonic doesn't require root privileges to run. It can be run as any user you like. For example, you could create a "subsonic" user and launch the strandalone process as that user. It will work as long as it can write its log files and read its database and any music folder in your collection.

If you have any problems running it with a regular user account, just look at the log files and adjust file permissions accordingly.
lavamind
 
Posts: 6
Joined: Sun Sep 27, 2009 11:45 pm

Postby 3R3 » Mon Nov 23, 2009 7:59 pm

thanks for the heads up, i didnt think of the logs, just thought java/subsonic/jetty somehow requires to be runs as root, because it failed to start otherwise. will change it right now.

another strange thing i noticed is this:
when i link the subsonic.sh startup-script in /var/subsonic to /usr/bin/subsonic with
Code: Select all
ln -s /var/subsonic/subsonic.sh /usr/bin/subsonic

it fails to load, if invoked from somewhere else than /var/subsonic although /usr/bin is obviously in the path.
but when i write a script, in which i just call /var/subsonic/subsonic/sh and place it in /usr/bin, i can start subsonic from everywhere via "subsonic".

what am i missing? why does the linking not work, but the script does?
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby mapes » Tue Feb 16, 2010 11:36 pm

Those of us running debian lenny might want to look at this command

update-alternatives --config java

This will change the links to sun java instead of the FSF java
mapes
 
Posts: 11
Joined: Wed Apr 29, 2009 4:44 pm

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 9 guests