Bug 130248 - httpd needs to have a sensible default VirtualHost explicitly defined
httpd needs to have a sensible default VirtualHost explicitly defined
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
Depends On:
  Show dependency treegraph
Reported: 2004-08-18 10:27 EDT by Reuben Farrelly
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-05 04:54:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Reuben Farrelly 2004-08-18 10:27:53 EDT
This statement:

# Load config files from the config directory "/etc/httpd/conf.d".
Include conf.d/*.conf

near the top of the httpd.conf, causes significant grief under 
certain circumstances.  This is because the first VirtualHost becomes 
the default VirtualHost for any unmatched entries.  The config 
shipped by fedora ought to have a _default_ Virtualhost to guard 
against this.

The breakage becomes apparent when an include file such 
as "awstats.conf" is put in conf.d/ as this now becomes the default 
page for non-specified hosts.

Ideally one of two things could be done to fix this:

1.  Create a "false" <Virtualhost> with the name aaaa.conf and put a 
temporary host in here such as the "Your Apache server is not 
configured appropriately"
2.  Set a default host _above_ the Include statement in httpd.conf
3.  Move Include.d/ down further in the config file (say, at the very 

I suggest that (2) is the easiest and best way to deal with this and 
thus make apache more tolerant of config problems.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Set up Virtualhosts
2. Point an IP address at the box, but do not configure a Virtualhost 
for it
3. View in browser

Expected Results:  The standard "Apache is not configured" page would 
be just fine as a default.

Additional info:
Comment 1 Joe Orton 2004-08-18 10:35:50 EDT
I'm not really confinced by this argument.  If awstats.conf is coming
from an awstats package, why is it changing with vhost setup?

Moving "Include conf.d/*.conf" around causes problems for other
modules, we moved it to this position to satisfy mod_jk2, IIRC.
Comment 2 Reuben Farrelly 2004-08-18 16:03:20 EDT
In more than one project, I have seen <Virtualhost> directives placed 
in files which are put into this directory to be included by apache.  
On reflection it seems that this is not the intention and that 
<Virtualhost> directives ought not to be put in here...is that 
correct?  If so, perhaps it would be an idea to state this explicitly 
in the README file in the directory itself.

I still think it would be a simple enhancement set a default host at 
the bottom of httpd.conf though ;-)

Comment 3 Joe Orton 2004-08-19 10:39:19 EDT
It wouldn't be simple though.

<VirtualHost _default_:80>

would be wrong when the admin changed the default Listen port, for
instance.  I think it's better to stick to "as simple as possible".
Comment 4 Joe Orton 2004-09-05 04:54:24 EDT
As above: unconvinced that this needs to change.

Note You need to log in before you can comment on or make changes to this bug.