On 4/27/07, Roberto Tortolero < roberto.tortolero@xxxxxxxxx> wrote:
> Hi
> I have problem with proxys on apache, i have two servers and i want to use
> one as a firewall an the other as web page server. i've all ready doned,
> but, the thing is that apache always returned the same carpet all the time,
> no matter what address i put, always redirect me to the first virtual host.
> what should a do???
>
> In the proxy server i have this on the httpd.conf:
>
> #el vhost para direccionar al otro servidor
> <VirtualHost xxx.xxx.xxx.77>
> #ProxyPreserveHost on
> ProxyPass / http://xxx.xxx.xxx.12/
> ProxyPassReverse / http://xxx.xxx.xxx.12/
>
> ServerName www.site1.com
> </VirtualHost>
>
> <VirtualHost xxx.xxx.xxx.77>
> #ProxyRequests On
> #ProxyVia On
>
> #ProxyPreserveHost on
> ProxyPass / http://xxx.xxx.xxx.12/
> ProxyPassReverse / http://xxx.xxx.xxx.12/
>
> ServerName www.site2.com
> </VirtualHost>
>
>
> and in the other server, the one that contains all the pages, have this
> config:
>
> <VirtualHost xxx.xxx.xxx.12 >
> VirtualDocumentRoot /usr/local/apache2/htdocs/site1/
> ServerName www.site1.com
> <Directory "/usr/local/apache2/htdocs/site1">
> allow from all
> Options +Indexes
> </Directory>
> </VirtualHost>
>
>
> <VirtualHost xxx.xxx.xxx.12>
> VirtualDocumentRoot /usr/local/apache2/htdocs/site2/
> ServerName www.site2.com
> <Directory "/usr/local/apache2/htdocs/site2">
> allow from all
> Options +Indexes
> </Directory>
> </VirtualHost>
>
> and no matter what address i put it always return me the first site on the
> second server, that one with the pages, the first viartualhost on the secand
> server.
-1. Your apache version is obsolete. You should try something more modern.
0. Did you read http://httpd.apache.org/docs/2.0/vhosts/name-based.html ?
1. You need the NameVirtualHost directive in both configs.
2. You'll need to uncomment those ProxyPreserveHost directives;
otherwise, the back-end host has no way to differentiate among the
requests for the two different vhosts.
3. You want the DocumentRoot directive, not VirtualDocumentRoot.
Joshua.
---------------------------------------------------------------------
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: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx