[TriLUG] I need help with Apache VirtualHost and proxy pass

Rick DeNatale rick at denhaven2.homeip.net
Fri Jul 16 22:43:55 EDT 2004


I'm trying to set up Apache so that if someone tries to access a
particular host name it passes the request on to a program running on
the same machine which listens on port 8080 for http requests. Any other
host name should be processed on the normal port 80 by httpd itself.

In other words, special.denhaven2.homeip.net should serve up from the
port 8080 daemon, www.denhaven2.homeip.net, or foo.denhaven.homeip.net
etc. should get the "normal" pages.

I've been tearing my hair out trying to get this to work.  If I
explicitly ask for www.denhaven2.homeip.net I get my normal page, but if
I ask for anythingelse.denhaven2.homeip.net I get the results from the
daemon on port 8080. In other words, the default is wrong.

Here's what I think is the relevant section of
my /etc/httpd/conf/httpd.conf:

NameVirtualHost *

<VirtualHost *>
    ServerAdmin webmaster at denhaven2.homeip.net
    DocumentRoot /var/www/html
    ServerName www.denhaven2.homeip.net
</VirtualHost>


<VirtualHost special.local.denhaven2.homeip.net:80>
	ServerAdmin webmaster at denhaven2.homeip.net
	ServerName special.denhaven2.homeip.net
	ServerAlias special
	ProxyPass /error/ !
	ProxyPass / http://192.168.0.40:8080/
	ProxyPassReverse / http://192.168.0.40:8080/
	<Location />
	  Order deny,allow
          Allow from all
        </Location>
</VirtualHost>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20040716/9f1acd04/attachment.pgp>


More information about the TriLUG mailing list