Re: Cacthing hosts

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

 



On 27-Feb-2010, at 04:20, Nilesh Govindarajan wrote:
> 
> This configuration has to be placed after all good vhosts; Otherwise all
> hosts give Error 400. Why ?

Because all hosts match.

This is not the best way to do it, wildcards are discouraged.

As Frank said:

On 26-Feb-2010, at 10:22, Frank Gingras wrote:
> If you want to define a dummy catch-all vhost, you should place it first, and set the ServerName to another value like your IP or a dummy name.

First Virtual Host:
<VirtualHost *>
  Servername 12.34.56.789
  RedirectMatch 400 ^/.*
</virtualhost>

then put the real virtual hosts you want to define down here

<virtualhost *>
  Servername www.example.com
  DocumentRoot /path/to/example.com
</virtualhost>

<virtualhost *>
  Servername www.example.net
  DocumentRoot /path/to/example.net
</virtualhost>


The servername in your dummy can be something else. dummy.example.com, for example, but making it the IP address is probably a good choice.

-- 
"You're just impressed by any pretty girl who can walk and talk."
"She doesn't have to talk."


---------------------------------------------------------------------
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