Apache Server configuration support - virtual host proxy question

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > February 2006 > virtual host proxy question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author virtual host proxy question
julian@isolve-online.com

2006-02-02, 8:06 am

Hello

I have a virtual host setup on apache 2.2 listening on port 80
(http://site1:80).

I would like all http requests to this virtual host to be served by an
application server (on the same machine) that is listening to port
8080. (http://appserver:8080). This process should be transparent to
the browser making the original request.

Does anyone know the best way of achieving this?

I am using

apache 2.2

linux fedora 4

application server : zope ZServer

and the admin tool webmin

Thank you

mikedawg@gmail.com

2006-02-02, 6:02 pm

The following in your httpd.conf for a reverse proxy:

ProxyRequests Off
<Proxy *>
Order deny,allow
allow from XXX.XXX.XXX.XXX
</Proxy>
ProxyPass / http://appserver:8080/
ProxyPassReverse / http://appserver:8080/

julian@isolve-online.com

2006-02-02, 6:02 pm

Thanks that works fine for the default site.

I have two virtual hosts and i would like only one of them to redirect
to the application server

Is this possible?

Many Thanks

mikedawg@gmail.com

2006-02-02, 6:02 pm

Sure, just put it in the VirtualHost part of your configuration.

julian@isolve-online.com

2006-02-02, 6:02 pm

I have tried a couple of combinations but cant seem to get it to work
please could you tell me how these two sections of code fit together

<VirtualHost _default_>
DocumentRoot /usr/local/apache2/sites/site1
ServerName site1
<Directory "/usr/local/apache2/sites/site1">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

and

ProxyRequests Off
<Proxy *>
Order deny,allow
allow from 192.168.10.111
</Proxy>
ProxyPass /site1 http://appserver:8080/
ProxyPassReverse /site1 http://appserver:8080/

Thanks

mikedawg@gmail.com

2006-02-02, 6:02 pm

<VirtualHost _default_>
DocumentRoot /usr/local/apache2/sites/site1
ServerName site1
<Directory "/usr/local/apache2/sites/site1">
allow from all
Options +Indexes
ProxyRequests Off
<Proxy *>
Order deny,allow
allow from 192.168.10.111
</Proxy>
ProxyPass /site1 http://appserver:8080/
ProxyPassReverse /site1 http://appserver:8080/
</Directory>
</VirtualHost>

julian@isolve-online.com

2006-02-02, 6:02 pm

I've put in your code and im getting the error

Proxy Requests not allowed here

on the line

ProxyRequests Off

Do you have any ideas?

mikedawg@gmail.com

2006-02-02, 6:02 pm

What happens when you comment out that single ProxyRequests line?

julian@isolve-online.com

2006-02-02, 6:02 pm

You get the following error message

Failed to apply changes :

Syntax error on line 424 of /usr/local/apache2/conf/httpd.conf

which refers to the line

<Proxy *>

Under ProxyRequests Off

mikedawg@gmail.com

2006-02-02, 6:02 pm

Hrmm. . . Yeah, try moving </directory> from its current location, and
move it above the ProxyRequests line

julian@isolve-online.com

2006-02-03, 7:49 am

I have moved directory above ProxyRequests,

It now compiles however the redirect does not work.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com