Integrating Subsonic into existing Apache Web Space

Tutorials, tips and tricks.

Moderator: moderators

Postby dguard » Thu Jun 25, 2009 8:35 pm

kamaradclimber wrote:there is no change, the same error message appears if i try to restart the apache server
(but it doesnt stop if i say so)

it doesnt matter, if subsonic works i'm happy
thanks you a lot !



I had been looking over this and was interested in getting it to work. I am using a LAMP server on Ubuntu Server with Apache 2.2.

What I had to do to get passed the same problem you are having.

Install mod_proxy:
sudo apt-get install libapache2-mod-proxy-html
sudo a2enmod proxy


I had to edit /var/subsonic/standalone/subsonic.sh
SUBSONIC_CONTEXT_PATH=/music

Edit /etc/apache2/sites-enabled/mysite.com and add the lines:

ProxyPass /music http://localhost:8080/music
ProxyPassReverse /music http://localhost:8080/music

Kill the previous subsonic PID, restart apache, start subsonic.sh

Now I can go to http://www.mysite.com/music with no problems.

Hope this helps someone
dguard
 
Posts: 1
Joined: Thu Jun 25, 2009 8:19 pm

Postby blightzero » Sat Jan 30, 2010 2:29 pm

Hello,

this setup works quite well for me with the Flashplayer, but how do I set this up with the external Player?
It keeps redirecting me to localhost, which obviously then is not working.
Addapting the stream url doesnt seem to work either.

Greetings,
blightzero
blightzero
 
Posts: 12
Joined: Sat Jan 30, 2010 2:27 pm

Solution.

Postby bjokri » Thu Feb 04, 2010 6:10 pm

kamaradclimber :

This is fixed my installing all the proxy modules for apache.
In debian type:

sudo a2enmod proxy *


Then follow the great guide. :)
bjokri
 
Posts: 1
Joined: Thu Feb 04, 2010 6:06 pm

Re: Integrating Subsonic into existing Apache Web Space

Postby tms8707056 » Tue Apr 06, 2010 3:04 pm

organon wrote:That configuration needs to be matched in the Subsonic config file with this directive:
Code: Select all
SUBSONIC_CONTEXT_PATH=/groovy



I used the Mac installer package and don't know where this file is located. It is the only thing keeping it from working.

I have already checked in /Library/Application Support/Subsonic/. Is the .properties file the correct file to add the line to? I see that it says it is automatically generated. Not sure.

Anybody know where to find the file?
tms8707056
 
Posts: 1
Joined: Tue Apr 06, 2010 3:02 pm

Postby subsonic_brad » Tue Apr 13, 2010 3:17 pm

Taking this one step further...

Is it possible to setup a virtual host in apache AND do the proxy too? For example...

Can I have subsonic.mydomain.com point to mydomain.com:8088/subsonic somehow?
subsonic_brad
 
Posts: 1
Joined: Tue Apr 13, 2010 3:15 pm

Postby westcoastoffense » Thu Apr 15, 2010 6:15 pm

I am trying to wrap my head around this and for whatever reason its not working for me. I set up the files exactly as mentioned earlier in the post, can access it over localhost, just not through apache.

I am using latest apache through XAMPP, and my server is running windows 7.

Also I can log onto my XAMPP config page, so I dont think it is a problem with the web server getting blocked by my router, isp, etc.
westcoastoffense
 
Posts: 5
Joined: Thu Apr 15, 2010 6:11 pm

Postby westcoastoffense » Sat Apr 17, 2010 5:34 pm

bump
westcoastoffense
 
Posts: 5
Joined: Thu Apr 15, 2010 6:11 pm

Re: Integrating Subsonic into existing Apache Web Space

Postby erdius » Tue Apr 20, 2010 11:35 pm

Did you ever figure out how to do this on mac?

tms8707056 wrote:
organon wrote:That configuration needs to be matched in the Subsonic config file with this directive:
Code: Select all
SUBSONIC_CONTEXT_PATH=/groovy



I used the Mac installer package and don't know where this file is located. It is the only thing keeping it from working.

I have already checked in /Library/Application Support/Subsonic/. Is the .properties file the correct file to add the line to? I see that it says it is automatically generated. Not sure.

Anybody know where to find the file?
erdius
 
Posts: 3
Joined: Tue Apr 20, 2010 11:34 pm

Postby steven444 » Wed May 19, 2010 10:57 am

nice post
steven444
 
Posts: 3
Joined: Wed May 19, 2010 10:48 am

Postby John Everett » Tue Jun 15, 2010 7:41 pm

subsonic_brad wrote:Taking this one step further...

Is it possible to setup a virtual host in apache AND do the proxy too? For example...

Can I have subsonic.mydomain.com point to mydomain.com:8088/subsonic somehow?


I have subsonic.mydomain.com pointing to mydomain.com:8088 with something like this in httpd.conf (or an included file):
Code: Select all
<VirtualHost *:80>
ProxyPass           / http://localhost:8088/
ProxyPassReverse    / http://localhost:8088/
ServerName subsonic.mydomain.com
</VirtualHost>

This is in instead of the ProxyPass* commands mentioned above. Also, you don't do the SUBSONIC_CONTEXT_PATH in subsonic.sh (since you're using the root of your virtual host, not a sub directory.)

Naturally, your httpd.conf needs to be otherwise configured for NameVirtualHost and mod_proxy (and you also need of course a DNS or hosts entry for subsonic.mydomain.com).
John Everett
 
Posts: 5
Joined: Tue Jun 15, 2010 7:28 pm

Postby satchakel » Mon Jul 04, 2011 10:36 am

Did you ever figure out how to do this on mac?

i'm interested to hear that too


---
Benefits and Highlights of GSM Repeater
GSM booster at Amazon 900Mhz
Last edited by satchakel on Mon Jul 14, 2014 2:42 pm, edited 2 times in total.
satchakel
 
Posts: 1
Joined: Mon Jul 04, 2011 10:34 am

Postby John Everett » Mon Jul 04, 2011 12:49 pm

John Everett wrote:
subsonic_brad wrote:Taking this one step further...

Is it possible to setup a virtual host in apache AND do the proxy too? For example...

Can I have subsonic.mydomain.com point to mydomain.com:8088/subsonic somehow?


I have subsonic.mydomain.com pointing to mydomain.com:8088 with something like this in httpd.conf (or an included file):
Code: Select all
<VirtualHost *:80>
ProxyPass           / http://localhost:8088/
ProxyPassReverse    / http://localhost:8088/
ServerName subsonic.mydomain.com
</VirtualHost>

This is in instead of the ProxyPass* commands mentioned above. Also, you don't do the SUBSONIC_CONTEXT_PATH in subsonic.sh (since you're using the root of your virtual host, not a sub directory.)

Naturally, your httpd.conf needs to be otherwise configured for NameVirtualHost and mod_proxy (and you also need of course a DNS or hosts entry for subsonic.mydomain.com).


I did the same on OSX 10.6.5. The Apache proxy_mod was enabled by default, so I just needed to configure it in httpd.conf:
Stop 'Web Sharing' in System Preferences|Sharing,
or
fix /usr/sbin/apachectl -- http://blog.deversus.com/2010/11/mac-os-1065-apachectl-usrsbinapachectl-line-82-ulimit-open-files-cannot-modify-limit-invalid-argument/ -- and
sudo apachectl stop

sudo cd /etc/apache2/
sudo vi httpd.conf


Code: Select all
#Make sure this stuff is enabled; it was on mine
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
#Add this to set proxy permissions; make more restrictive if you prefer
<Proxy *>
    Order deny,allow
    Deny from all
    Allow from all
</Proxy>
#Add this to set the default web page, when no redirected domain is called
NameVirtualHost *:80
<VirtualHost *:80>
        DocumentRoot /Library/WebServer/Documents
        ServerName mac.mydomain.com
        ServerAlias mac
</VirtualHost>


Next, create the config file to configure the virtual/proxy host for subsonic:
sudo vi /private/etc/apache2/other/subsonic.conf

#add this section
<VirtualHost *:80>
#ProxyPreserveHost On
ProxyPass / http://localhost:4040/
ProxyPassReverse / http://localhost:4040/
ServerName subsonic.mydomain.com
</VirtualHost>

restart 'Web Sharing' in System Preferences
or
sudo apachectl start

Now, assuming that subsonic.mydomain.com is in your DNS pointing to your Mac, calls to that domain will go to Subsonic running on 4040; any other calls to the web server will go to the standard pages in /Library/WebServer/Documents

Of course, the code above with 'mac/subsonic.mydomain.com' needs to be replaced with your specific hosts/domain names.
John Everett
 
Posts: 5
Joined: Tue Jun 15, 2010 7:28 pm

Postby steve1977 » Wed Jul 06, 2011 9:22 am

Pulling up an old thread to keep things in order. I followed the advice in this thread and got my-URL/subsonic working. Also my-IP:8900/subsonic (8900 is my subsonic port) remains to be working. Both is great.

However, what is strange is that my-IP/subsonic does not work. It still re-routes me to my-IP/index.view, which for obvious reasons does not work. No clue why my-URL understands it, but my-IP not...

Any thoughts?
steve1977
 
Posts: 20
Joined: Wed Jul 06, 2011 8:10 am

changing internal port number from 4040 to 80 for Mac OS X

Postby lovebags » Fri Jul 22, 2011 9:17 am

Collating the above helpful info, this is how made the modification on Mac OS X to route port 4040 to run on port 80. This means that my users no longer have to type in the 4040 port number.

In terminal type: sudo pico /etc/apache2/httpd.conf

Scroll down to about 8 pages to below the 'Main' server configuration line and in between the # symbols, copy and paste the following:

<VirtualHost *:80>
ProxyPass / http://localhost:4040/
ProxyPassReverse / http://localhost:4040/
ServerName subsonic.mydomain.com
</VirtualHost>

(The server name is your own subdomain)

Exit and save the file in the editor then uncheck and re-check 'web sharing' in system preferences.
User avatar
lovebags
 
Posts: 86
Joined: Wed Feb 02, 2011 1:49 am

Postby br0ken1128 » Fri Aug 12, 2011 1:21 pm

Here's the problem I have ..

I have a web server on my cable connection that's running debian, it's a slower machine so I don't run subsonic on it, it just doesn't have the memory or processor power to handle the transcoding and all that.

I run subsonic on my desktop machine which is a much much beefier system ( I use it for 3d rendering and music composition ) .. that works fine.. I port forwarded 443 to my desktop from my router so I can get to it, albeit with a certificate error.

However, I wanted to make use of some of the sharing features subsonic has so I figured I'd set up the reverse proxy in apache, but seems it doesn't work so well because when I set it up, subsonic wants to redirect me to the local IP..

Code: Select all
ProxyPass           /ss http://192.168.0.124:80/ss
ProxyPassReverse    /ss http://192.168.0.124:80/ss


This is in my apache config, 0.124 is my desktop machine running subsonic and it's configured for /ss as the context path ..

if I go to http://mydomain.com/ss then it sits there for a while and then comes back with https://192.168.0.124/ss in the url and ofcourse gives an error saying it couldn't open it.

I tried setting up a local port foward on linux so that I could try localhost:80/ss and that also failed, it redirected me to localhost:80/ss with the same error..

Is there any way to get this to work? my linux box is a web server I use .. I can't just shut port 80 off there and direct it to my desktop.. [/code]
br0ken1128
 
Posts: 17
Joined: Tue Aug 09, 2011 11:41 am

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 16 guests