views:

545

answers:

1

My roommate and I each have a separate webserver we are trying to set up. We are trying to use mod_proxy so that his server will forward requests to my machine (we have two seperate machines behind one router) based on the server name. I've given the basics of what we have in our apache config currently but we are getting a 403 Forbidden error when trying to access the second domain (the first, www domain, works fine).

NameVirtualHost *:80

<VirtualHost *:80>
 DocumentRoot /var/www
 ServerName www.<domain1>.com
</VirtualHost>

<VirtualHost *:80>
 ProxyPreserveHost On
 ProxyPass / http://&lt;IP addr of other box>:80
 ProxyPassReverse / http://&lt;IP addr of other box>:80
 ServerName <dummydomain>.gotdns.com
</VirtualHost>
+1  A: 

Your mods-enabled/proxy.conf might be blocking any proxy requests (it's deny all by default). It should include the following instead:

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

EDIT: Also make sure that the mod_proxy submodules are sym linked into mods-enabled (in this case, the http sub module which is mods-available/proxy_http.load)

Jeremy Stanley
Just tried this and started to get an Internal Server error instead. any ideas about issues?
Pete
What does the apache log say?
Jeremy Stanley
Updated the answer with what I'm guessing is the next problem
Jeremy Stanley
Got it to work. had to allow proxy requests and then didn't have proxy_http enabled. but we got it. Thanks for the help!
Pete