PDA

View Full Version : How to Use Apache as Proxy?



Stephen Nesbitt
2005-01-01, 14:19
All:

Has anyone setup Apache to serve as a front end to the slimserver (I think
it's called a reverse proxy?) Basically I want to to be able to use the URL
http://jukebox.<domain id> to connect to Apache and then have that forwarded
to the server on port 9000.

Is so, can someone share the config?

I scanned the list and see one reference back in Sept. but it didn't offer
enough info.

Thanks,

-steve

Jack Coates
2005-01-01, 15:01
Stephen Nesbitt wrote:
> All:
>
> Has anyone setup Apache to serve as a front end to the slimserver (I think
> it's called a reverse proxy?) Basically I want to to be able to use the URL
> http://jukebox.<domain id> to connect to Apache and then have that forwarded
> to the server on port 9000.
>
> Is so, can someone share the config?
>
> I scanned the list and see one reference back in Sept. but it didn't offer
> enough info.
>
> Thanks,
>
> -steve

enable proxypass, then add this:

ProxyPass /jukebox http://192.168.1.1:9000
ProxyPassReverse /jukebox http://192.168.1.1:9000

--
Jack at Monkeynoodle dot Org: It's a Scientific Venture...
Riding the Emergency Third Rail Power Trip since 1996!

Jeff Shanholtz
2005-01-01, 15:13
On Sat, 1 Jan 2005 13:19:10 -0800, Stephen Nesbitt wrote:

> Has anyone setup Apache to serve as a front end to the slimserver (I think
> it's called a reverse proxy?) Basically I want to to be able to use the URL
> http://jukebox.<domain id> to connect to Apache and then have that forwarded
> to the server on port 9000.

I've done something similar for another purpose. This example uses SSL as
well as authentication, so if you don't need one or both of those, remove
the related directives.

<VirtualHost *:9001>

# SSL options start
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
# SSL options end

ProxyRequests off
<Proxy *>
order deny,allow
allow from all

# authentication options start
AuthName "Restricted Realm"
AuthType Basic
AuthUserFile /etc/custom/myapachepasswordfile
Require user myname
# authentication options end

</Proxy>

ProxyPass / http://192.168.0.1:9000/
ProxyPassReverse / http://192.168.0.1:9000/
</VirtualHost>

Marc Sherman
2005-01-01, 15:13
Jack Coates wrote:
>
> enable proxypass, then add this:
>
> ProxyPass /jukebox http://192.168.1.1:9000
> ProxyPassReverse /jukebox http://192.168.1.1:9000
>

For http://jukebox.my.domain/, you'll need to put / instead of /jukebox
in the domain, and you'll need to put the whole thing inside a virtual
host block:

<VirtualHost *:80>
ServerName jukebox.my.domain
ProxyPass / http://slimserver.machine.my.domain:9000
ProxyPassReverse / http://slimserver.machine.my.domain:9000
</VirtualHost>

- Marc

Stephen Nesbitt
2005-01-04, 10:34
All:

Thanks that got me closer.

I now have one additional problem. I am getting a 403 Forbidden error when
trying to access the setup.html. Based on the log, see below, the problem
seems to be caused because of "Invalid Referer"

Note, I did post this same question in another message, but my title was
pretty poor and I got no responses.

Thanks!

-steve


2005-01-02 16:41:39.2615 Accepted connection 1 from 192.168.0.4
2005-01-02 16:41:39.2637 reading request...
2005-01-02 16:41:39.2644 HTTP request: from 192.168.0.4
(HTTP::Daemon::ClientConn=GLOB(0xf6b0fffc)) for GET
HTTP/1.1 /setup.html?page=server&player=00%3A04%3A20%3A05%3A56%3Aea
2005-01-02 16:41:39.2653 HTTP parameter page = server
2005-01-02 16:41:39.2660 HTTP parameter player = 00:04:20:05:56:ea
2005-01-02 16:41:39.2672 Invalid referer:
[GET /setup.html?page=server&player=00%3A04%3A20%3A05%3A56%3Aea]
2005-01-02 16:41:39.2679 generating from html/errors/403.html

marcosscriven
2005-10-19, 07:55
I'm getting exactly the same issue - '403 forbidden' when trying to access the setup.

Two other issues (which I guess are related)

1)Only one player can be added, and it comes up as 127.0.0.1
2)The player won't 'play'. If I click play, it doesn't highlight, and nothing plays... :(