Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>answer 1 is correct and i'd add with namevirtualhosts as the first entry essentially matches any not-named elsewhere virtualhost</p> <p>it should ONLY be used to catch unintentional mal-formed and broken traffic</p> <p>ie a machene with one ip called john.domain.com running www.domain.com and www.domain2.com as valid webservers on ip www.xxx.yyy.zzz might have an optimal config like thus</p> <pre><code> &lt;VirtualHost *:80&gt; DocumentRoot /var/webserver/static-sites/unknown/ # a directory readable by apache with only a robots.txt denying everything ServerName bogus ErrorDocument 404 "/errordocuments/unknown-name.html" #custom 404 describing how/what they might have done wrong try pointing a browser {with a hosts file at http://bogus/ on 193.120.238.109 to see mine# ErrorLog /var/log/httpd/unknown-error.log CustomLog /var/log/httpd/unknown-access.log combined &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; DocumentRoot /var/webserver/static-sites/unknown/ # a possibly different directory readable by apache with only a robots.txt denying everything ServerName www.xxx.yyy.zzz ServerAlias john.domain.com ErrorDocument 404 "/errordocuments/ip-name.html" ErrorDocument 403 "/errordocuments/ip-name.html" #custom 404 telling them as a likely hacker/bot you wish to have nothing to do with them see mine at http://193.120.238.109/ ErrorLog /var/log/httpd/ip-error.log CustomLog /var/log/httpd/ip-access.log combined &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; ServerName domain.com RedirectPermanent / http://www.domain.com/ ErrorLog logs/www.domain.com-error.log CustomLog logs/www.domain.com-access.log combined &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; DocumentRoot /var/webserver/ftpusers/domain ServerName www.domain.com ServerPath /domain ErrorLog logs/www.domain.com-error.log CustomLog logs/www.domain.com-access.log combined &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; ServerName domain2.com RedirectPermanent / http://www.domain2.com/ ErrorLog logs/www.domain2.com-error.log CustomLog logs/www.domain2.com-access.log combined &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; DocumentRoot /var/webserver/ftpusers/domain2 ServerName www.domain2.com ServerPath /domain2 ErrorLog logs/www.domain2.com-error.log CustomLog logs/www.domain2.com-access.log combined &lt;/VirtualHost&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload