SOLVED: Re: [users@httpd] Mixed VirtualDocumentRoot and VirtualHost directives

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

 



On 10/21/2012 10:19 PM, Eric Covener wrote:
On Sun, Oct 21, 2012 at 8:50 PM, Terry Carmen<terry@xxxxxxxxxxxxxx>  wrote:
I have a very stable server that's been happily running a number of
name-based virtual hosts with nothing more than:

UseCanonicalName Off
VirtualDocumentRoot /var/www/html/%0

This responds correctly towww.example.com, example.com, example.net and
anything else defined in the VirtualDocumentRoot directories.

However now I'm running YaCY (P2P web search) which listens on port 8090 and
does not exist as a location in the filesystem, and I'd like Apache to proxy
all requests for search.example.com to 127.0.0.1:8090.

I've tried adding the code below, however this breaks the
VirtualDocumentRoot and the server no longer serves the other virtualhosts.


<VirtualHost *:80>
         ServerName search.example.com
         ServerAdminwebmaster@xxxxxxxxxxx

         ProxyRequests Off

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

         ProxyPass /http://127.0.0.1:8090/
         ProxyPassReverse /http:/127.0.0.1:8090/
</VirtualHost>

Add a vhost preceding this w/ your VirtualDocumentRoot -- it will be
the default as first listed.  See apachectl -S output for hints.


apachectl -S was very helpful, thanks!

For some reason, it also needed a NameVirtualHost to stop complaining about overlaps. Not sure why.

In any case, here's the working config in case anybody ever needs it (or I need it again sometime) 8-)

Thanks again for the help!

Terry


ServerAdmin postmaster@xxxxxxxxxxx
ServerName www.example.com
NameVirtualHost *:80

<VirtualHost *:80>
        ServerName %0
       # ServerAdmin webmaster@xxxxxxxxxxx
        VirtualDocumentRoot /var/www/html/%0
</VirtualHost>


<VirtualHost *:80>
        ServerName search.example.com

        ProxyRequests Off

        <Proxy search.example.com>
                Order deny,allow
                Allow from all
        </Proxy>

        ProxyPass / http://127.0.0.1:8090/
        ProxyPassReverse / http:/127.0.0.1:8090/
</VirtualHost>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-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