Here is a simpler way: (This works only if the other server is within the
LAN). I have the drive from the other server mapped into the main server. In
the config file I entered, in your case if would look like this:
############

Alias /bb "D:/phpBB2"
# where D is the mapped drive with the directory /phpBB2
<Directory "D:/phpBB2">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

###########

Then http://www.foo.com/bb fire up your phpBB2 application.


-----Original Message-----
From: Brian Bonner [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 12, 2006 12:00 PM
To: users@httpd.apache.org
Subject: [EMAIL PROTECTED] Name-based Virtual Hosts and Reverse Proxy with
ProxyPreserveHost On


Hello.

I have a Apache 2.2 setup in a reverse proxy configuration.

On the Proxy Server I have:

NameVirtualHost  *:80

<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot /var/www/foo/html
    ServerName www.foo.com
    ErrorLog logs/www.foo.com-error_log
    CustomLog logs/www.foo.com-access_log common

    ProxyPreserveHost On

    ProxyPassReverseCookiePath     /JSPWiki /wiki
    ProxyPass               /wiki   http://app1.internal.com:8080/JSPWiki
    ProxyPassReverse        /wiki   http://app1.internal.com:8080/JSPWiki

    ProxyPass               /bb    http://app1.internal.com/phpBB2
    ProxyPassReverse        /bb    http://app1.internal.com/phpBB2

    ProxyPass              /  http://app1.internal.com/
    ProxyPassReverse  /   http://app1.internal.com/

</VirtualHost>


<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot /var/www/bar/html
    ServerName www.bar.com
    ErrorLog logs/www.bar.com-error_log
    CustomLog logs/www.bar.com-access_log common

    ProxyPreserveHost On

    ProxyPassReverseCookiePath     /JSPWiki /wiki
    ProxyPass               /wiki   http://app1.internal.com:8080/JSPWiki
    ProxyPassReverse        /wiki   http://app1.internal.com:8080/JSPWiki

    ProxyPass               /bb   http://app1.internal.com/phpBB2
    ProxyPassReverse        /bb    http://app1.internal.com/phpBB2

    ProxyPass              /  http://app1.internal.com/
    ProxyPassReverse  /   http://app1.internal.com/
</VirtualHost>


On the internal box  (app1.internal.com) I have:

NameVirtualHost  *:80
<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot /var/www/html
    ServerName www.foo.com
    ErrorLog logs/www.foo.com-error_log
    CustomLog logs/www.foo.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot /var/www/bar/html
    ServerName www.bar.com
    ErrorLog logs/www.bar.com-error_log
    CustomLog logs/www.bar.com-access_log common
</VirtualHost>


My intent was to be able to add virtual hosts to the configuration files of
the two servers and not have to setup separate IP Addresses for the virtual
hosts to proxy to.

When I access http://www.foo.com/wiki,  it returns:
404
The requested URL /JSPWiki/ was not found on this server.

The log on the proxy server is generating this request which doesn't make
any sense since it's being proxied.

When I access http://www.foo.com/bb,  it returns:
404
The requested URL /phpBB2/ was not found on this server.


I'd prefer not to have the reverse proxy pass *everything* through to the
back end server that is doing the virtual hosting and then proxy it again.
I don't believe this is how it should work, but I need some advice.  Again,
I was trying to get around having to configure separate DNS Entries for the
virtual hosts that sit on the same box. I guess I can go back to this, but I
thought this should work.

Any insight would be helpful.

Thanks.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info. To
unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/337 - Release Date: 5/11/2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/337 - Release Date: 5/11/2006
 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to