Re: Re: virtualhost via proxy on apache 2.0.40 problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



well, thank you joshua, but aparently, the problem was in on directive in the second server, the directive is DirectoryIndex wish it come in one conditional, and it seems that always pass away that directive. Now everithing, by the moment, is working very well...
And my version of apache works perfectly, right now i don`t need more, but thanks for the recommendation...

Thanks a lot


On 4/27/07, Joshua Slive <joshua@xxxxxxxx> wrote:
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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux