PDA

View Full Version : Apache Proxy Help



soapee01
2006-04-12, 07:04
I hope this is the correct forum to post in.

I'm having some issues getting apache (on Debian) to properly forward to SlimServer on another Debian machine.

FWIW, everything is running fine on the LAN side, and SoftSqueeze works fine via SSH Tunnels. I've tried the setup a couple of different ways. The first follows Apache proxy tutorials, and the second as recommended on the slimserver mailing lists.

The first configuration is basically outputting what I see in lynx on the lan (not running the scripts). Here's config 1 (feel free to try it out at http://www.stubbornroses.com/slim1/):



ProxyPass /slim1/ http://192.168.1.100:9000/
ProxyHTMLURLMap http://192.168.1.100:9000 /slim1

<Location /slim1/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap 192.168.1.100:9000/ /slim1/
ProxyHTMLURLMap /slimdesk /slim1
RequestHeader unset Accept-Encoding
RequestHeader set Referer http://192.168.1.100:9000/
</Location>



Configuration two starts to work better (scripts at least sort of run), but it fails with:


Transport Error: 404
Are you sure that SlimServer is running and your network connection is up?


Here's my second configuration (which can be tested at http://www.stubbornroses.com/slim2/):



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


I'm don't really understand what's going on here, so I'd really appreciate any advise that can be given.

Regards,

soapee01

cliveb
2006-04-12, 08:20
I'm not familiar with what the <Location> section is supposed to do, but concerning the ProxyPass directives, have you remembered to load the appropriate proxy modules (in this case, I think you need to load the modules called "proxy_module" and "proxy_http_module")?

soapee01
2006-04-12, 09:00
I'm not familiar with what the <Location> section is supposed to do, but concerning the ProxyPass directives, have you remembered to load the appropriate proxy modules (in this case, I think you need to load the modules called "proxy_module" and "proxy_http_module")?

I did all of those things... I should have included how they were configured as well. Debian does this a bit different. All of this info comes from about 5 different files, so I forgot to include it. Thanks for the advice though.




LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule cache_module /usr/lib/apache2/modules/mod_cache.so
LoadModule disk_cache_module /usr/lib/apache2/modules/mod_disk_cache.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadFile /usr/lib/libxml2.so

<IfModule mod_proxy.c>

ProxyRequests Off

<Proxy *>
Order deny,allow
Deny from all
Allow from all
</Proxy>

ProxyVia On

CacheRoot "/var/cache/apache2/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1

</IfModule>


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

soapee01
2006-04-13, 09:26
I found all of my problems, and wrote a howto on the debian wiki. For others running debian (and possibly Ubunutu), you can find my howto at:

http://wiki.debian.org/SlimServerHowto

Hopefully this will help others.