BobV
BobV

Reputation: 1

Apache VirtualHost DocumentRoot to another server

I run two webservers, each in their own VM under Proxmox.

Incoming web traffic goes to one of these. That one has a .conf file with various <VirtualHost> entries to send traffic to the correct locations for sites on that server (/var/www/xyx etc).

But I want one of those entries have a DocumentRoot directive to point to a different server on the same Proxmox machine.

I've tried variations of these entries, but they didn't work:

   DocumentRoot http://192.168.01.022
   DocumentRoot "http://192.168.01.022"
   DocumentRoot 192.168.37.222

I then went down a rabbit hole talking about ProxyPass etc so I tried many variations of:

   ProxyPreserveHost on
   ProxyPass        / http://192.168.37.222
   ProxyPassReverse / http://192.168.37.222

Nothing seemed to work, the best I got was an "403 Forbidden, You don't have permission to access this resource" error. (Each VM can open a website on the other but maybe that's because I am root user?)

So two questions:

  1. what is the correct syntax to use in the <VirtualHost> entry?
  2. If I get the redirect to work, how do I get the correct permissions passed through?

As said above, I've tried using VirtualHosts and Proxy servers, I haven't looked at redirects

Upvotes: 0

Views: 33

Answers (0)

Related Questions