logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: proxypass + proxypassreverse + virtualhost
Author
takerushi



Joined: 10 May 2007
Posts: 4

PostPosted: Thu 10 May '07 3:11    Post subject: proxypass + proxypassreverse + virtualhost Reply with quote

How are you? I have been searching through this forum trying to look up some way to mess with my URL, still can't find it answer, hope you can help me out! Thanks in advance!!!

I ran a proxy server through proxy module. I am able to point the proxy to one of my server, let's say, www.abcd.com, and then I would like to point server2.abcd.com to the documentroot that reside on the proxy server, let's say server2.abcd.com should point to /home/server2/public_html
Here is my virtual host section in httpd.conf

############################################

NameVirtualHost *:80

<VirtualHost *>
ServerName www.abcd.com
ServerAlias www.abcd.com
ServerAdmin webmaster@abcd.com

ProxyRequests Off

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

ProxyPass /index.html http://192.111.0.111
ProxyPassReverse /index.html http://192.111.0.111

</VirtualHost>


<VirtualHost *>
ServerName server2.abcd.com
ServerAlias server2.abcd.com
ServerAdmin webmaster@abcd.com

DocumentRoot /home/server2/public_html
</VirtualHost>
############################################

Problems:
1. I have my DNS set to go to this IP for all request of www.abcd.com and server2.abcd.com, hoping the virtual host can determine with name will go where, but infact, it always bring me to place point by the first virtual host, even if I swap the position of two virtual host above.


Question.
1. How can I ask the proxy server to point to the right location upon the request. For example, www.abcd.com will go to http://192.111.0.111 and server2.abcd.com will go to /home/server2/public_html instead of all being direct to http://192.111.0.111

Thanks.
Back to top
slamdunk872001



Joined: 13 Apr 2007
Posts: 6
Location: Ho Chi Minh

PostPosted: Thu 10 May '07 5:05    Post subject: Reply with quote

try this one and edit a documentroot


Code:
<VirtualHost *:80>
   ServerName abcd.com
   ServerAlias www.abcd.com
   DocumentRoot "E:/Appserv/www/"
</VirtualHost>

<VirtualHost *:80>
   ServerName abcd.com
   ServerAlias server2.abcd.com
   DocumentRoot "E:/Appserv/www/server2"
</VirtualHost>
Back to top


Reply to topic   Topic: proxypass + proxypassreverse + virtualhost View previous topic :: View next topic
Post new topic   Forum Index -> Apache