[Cialug] Apache default VH configuration

Josh More MoreJ at alliancetechnologies.net
Fri Apr 30 11:03:27 CDT 2010


When you're doing name-based virtual hosting, the hosts are parsed in alphabetical order.

Add a "ServerName aaaaaaaaaaaaaaa.no.site.exists" to the default.  See if that gives you the behavior you want.


-Josh More, CISSP, GIAC-GSLC, GIAC-GCIH, RHCE, NCLP
morej at alliancetechnologies.net
515-245-7701

________________________________________
From: cialug-bounces at cialug.org [cialug-bounces at cialug.org] on behalf of L. V. Lammert [lvl at omnitec.net]
Sent: Friday, April 30, 2010 11:02
To: Central Iowa Linux Users Group
Subject: [Cialug] Apache default VH configuration

Setting up a new server with all name VH sites, .. using the following
config for the default to return an error if a VH name is not detected:

<VirtualHost *:80>
    CustomLog /var/www/logs/attack.log combined
    ErrorLog /var/www/logs/error.log
    LogLevel emerg

    ErrorDocument 403 "Site does not exist on this server!"
    <Location />
        Order allow,deny
        Deny from all
    </Location>
</VirtualHost>

For some reason, *one* of the VHs seems to 'override' the default,
returning that site on a query to the base IP address. Other VHs operate
properly, and do not affect the default error message. The only difference
between the VH files is the path names, .. and the order of VH load does
not seem to affect the problem.

Is anyone using a similar config or seen a problem such as this?

        TIA,

        Lee
_______________________________________________
Cialug mailing list
Cialug at cialug.org
http://cialug.org/mailman/listinfo/cialug


More information about the Cialug mailing list