PDA

View Full Version : Apache Proxy Problem



rvenki
2005-07-11, 09:09
Hi
I have succesfully installed Slimserver in my SuSE 9.1 linux.
I can access my http://localhost:9000/stream.mp3 from my LAN. However I am unable to access my http://homeserver_ip:9000/stream.mp3 from work because of firewall issues.
I tried using Apache Proxy.
I have added the following lines into my httpd.conf

ProxyPass /slim http://localhost:9000/
ProxyReversePass /slim http://localhost:9000/

I tried accessing my slim server from work by
http://homseserver_ip/slim

This forwards the request to http://localhost:9000/
But I am getting a page not found, in the apache logs I am seeing
"htdocs/player_list.htm not found".
I think Apache is trying to find these pages in its document directory for some reason.

please help

thanks
Venki

Mark Miksis
2005-07-11, 16:50
What happens if you try http://homseserver_ip/slim/ ?

Also, this link may help...
http://www.apacheweek.com/features/reverseproxies

nmizel
2005-07-11, 17:14
Hi,

This is the proxy configuration I use with SlimServer 5.4.1 and Apache 2.0.52.

<IfModule !mod_proxy_html.c>
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
</IfModule>

<Location /slimserver/>
RequestHeader set Referer http://localhost:9000/
ProxyPass http://localhost:9000/
ProxyPassReverse http://localhost:9000/
ProxyHTMLURLMap http://localhost:9000 /slimserver
SetOutputFilter proxy-html
ProxyHTMLURLMap / /slimserver/
ProxyHTMLURLMap /slimserver /slimserver
</Location>

Hope this helps,
Nicolas

rvenki
2005-07-11, 20:58
Thanks a lot guys.
It is working now. I have to recompile my apache with mod_proxy_html. That did it.

I am able to get my stream remotely.

However, if I play a song and stream it, the stream is bit jumpy.
I am hearing song with lot of disturbances. It is playing with lot of jumps.

Have you guys encountered this problem.
Is this something to do with caching


thanks
Venki

nmizel
2005-07-12, 04:44
However, if I play a song and stream it, the stream is bit jumpy.
I am hearing song with lot of disturbances. It is playing with lot of jumps.

It depends on your network upstream bandwidth (especially if like me you stream from your home broadband dsl line).

To get a smooth playback, you can limit the bitrate of your "player" under:

- Player Settings for <your external ip>
- - Audio
- - - Bitrate Limiting

Nicolas

rvenki
2005-07-12, 08:48
Hi Nicolas

The same streaming session (320kbps) worked fine before I put a Apache proxy in front of it.

After having the proxy I am getting diturbances and breaks in my songs.

I have installed lame encoder and played around with changing the bit rate (64 - 320).

None of the setting (64 - 320) seems to solve my problem.

I am doing 256 with Lame Quality level of 9 (poor).

Still I am having breaks.

Is there any change Apache is caching some of these streams and causing disturbances.


I appreciate your help

Venki

Marc Sherman
2005-07-12, 11:31
nmizel wrote:
>
> <IfModule !mod_proxy_html.c>
> LoadFile /usr/lib/libxml2.so
> LoadModule proxy_html_module modules/mod_proxy_html.so
> </IfModule>
>
> <Location /slimserver/>
> RequestHeader set Referer http://localhost:9000/
> ProxyPass http://localhost:9000/
> ProxyPassReverse http://localhost:9000/
> ProxyHTMLURLMap http://localhost:9000 /slimserver
> SetOutputFilter proxy-html
> ProxyHTMLURLMap / /slimserver/
> ProxyHTMLURLMap /slimserver /slimserver
> </Location>

Are all those url maps really required? Don't the first and second one
do the same thing (map root to /slimserver), and isn't the third one a noop?

- Marc

nmizel
2005-07-12, 15:27
Are all those url maps really required? Don't the first and second one
do the same thing (map root to /slimserver), and isn't the third one a noop?


Hello Marc,

You're right. The last one also looks useless to me. I remember I did put the first url map in case the server was passing a fully qualified url, but as it doesn't seem to be the case we can get rid of it.

So the updated configuration is now as follows:

<IfModule !mod_proxy_html.c>
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
</IfModule>

<Location /slimserver/>
RequestHeader set Referer http://localhost:9000/
ProxyPass http://localhost:9000/
ProxyPassReverse http://localhost:9000/
SetOutputFilter proxy-html
ProxyHTMLURLMap / /slimserver/
</Location>

The RequestHeader directive is required to trick the server to allow access to the settings pages.

It is also necessary to add:

AllowEncodedSlashes On

somewhere in the httpd.conf to avoid broken images when album artwork is used as covers urls contain encoded slashes.

Nicolas

rvenki
2005-07-12, 15:44
Hi Guys.
Thanks a lot for all your help.
My Apache proxy is working fine now. I can get the stream from work.

But the problem I am facing is it very jumpy (plays as if it skips some part of song and continues again).
I am not hearing a continous song.

You guys suggested the change the bit rate, which I did (64 - 320) none of them seems to solve this problem.

If I hear this by using http://localhost:9000/stream.mp3, it works fine.

I am having this problem only when I use Apache as proxy.


thanks
Venki

nmizel
2005-07-13, 14:24
Hello Venki,

Do you also have problems when accessing your proxy locally (i.e. from your home network)? Also, try to experiment with various players (Media Player, Winamp, ...).

Nicolas

rvenki
2005-07-13, 16:09
This is what happens.

Inside my home (inside my LAN)

If I access http://server_ip:9000/stream.mp3 (without proxy) everything works like a charm.

If I access http://server_ip/slim/stream.mp3 (with proxy), I am having audio breaks.

Outside my home (outside my LAN)

If I access http://wan_ip/slim/stream.mp3 (with proxy), I am having audio breaks.

So defnly the problem is with Apache proxy.

I will defnly try different players see what happens.

thanks
Venki

scratchy
2007-01-12, 01:00
Here is my httpd configuration that seems to work with Apache 2.0.53 and SlimServer 6.5.0 (note that the "sed" filter was not needed for SlimServer 6.3.1):

<IfModule !mod_proxy_html.c>
LoadFile /usr/lib/libxml2.so.2
LoadModule proxy_html_module modules/mod_proxy_html.so
</IfModule>

<IfModule !mod_ext_filter.c>
LoadModule ext_filter_module modules/mod_ext_filter.so
</IfModule>

ExtFilterDefine slimserver-sed mode=output intype=text/html cmd="/bin/sed -e 's#\\(url\\s*=\\s*./\\)#\\1slimserver/#g'"

<Location /slimserver/>
RequestHeader set Referer http://localhost:9000/
ProxyPass http://localhost:9000/
ProxyPassReverse http://localhost:9000/
SetOutputFilter proxy-html;slimserver-sed
ProxyHTMLURLMap / /slimserver/
</Location>

scratchy
2007-01-12, 01:10
http://forums.slimdevices.com/showthread.php?t=31571