Bug 97081 - redhat-config-httpd generates faulty httpd.conf configuation for second virtual server
Summary: redhat-config-httpd generates faulty httpd.conf configuation for second virtu...
Keywords:
Status: CLOSED DUPLICATE of bug 89947
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-httpd
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-06-10 01:35 UTC by Elliot Mackenzie
Modified: 2015-03-05 01:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-21 18:56:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Elliot Mackenzie 2003-06-10 01:35:28 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3.1) Gecko/20030425

Description of problem:
I create two name-based virtual servers (no default server), WWW.A.COM and
WWW.B.COM.

I specify a basic working configuration, including specifying DirectoryIndex for
both virtual servers as "index.php index.html index.htm, index.shtml".  

On save, the DirectoryIndex tag is not generated for the second virtual server,
and as such the generated httpd.conf is invalid.  A visit to http://www.a.com/
will work, http://www.b.com/ will generate the apache test page, whilst
http://www.a.com/index.html and http://www.b.com/index.html both will work.


Version-Release number of selected component (if applicable):
redhat-config-httpd-1.0.1-18

How reproducible:
Always

Steps to Reproduce:
1.Set up a default web server using the tool
2.Create two name-based virtual servers (no default server)
3.Specify any working configuration
4.Save and exit the tool
5.View httpd.conf to compare output transcript below
6.Run apache to confirm results.


Actual Results:  The first vserver works fine, the second does not.  It appears
as though the config tool is not adding the DirectoryIndex tag for the second
virtual server as it should.

An example broken output is:
========================================
# Virtual host www.a.com
<VirtualHost 203.<snip>>
        DocumentRoot /var/www/html/a/
        ErrorLog logs/error_log-a
        ServerName www.a.com
        ServerSignature off
        TransferLog logs/access_log-a
        DirectoryIndex index.php index.html index.htm index.shtml
        TransferLog logs/access_log-a
        ErrorLog logs/error_log-a
        LogLevel debug
        HostNameLookups off
</VirtualHost>

# Virtual host www.b.com
<VirtualHost 203.<snip>>
        DocumentRoot /var/www/html/b
        ErrorLog logs/error_log-b
        ServerName www.b.com
        ServerSignature off
        TransferLog logs/access_log-b
        TransferLog logs/access_log-b
        ErrorLog logs/error_log-b
        LogLevel debug
        HostNameLookups off
</VirtualHost>
=============================================
The end result is that a visit to http://www.a.com/ works, http://www.b.com/
returns the apache test page (reporting error access forbidden by rule), and
http://www.b.com/index.html works.  

Expected Results:  You will note that the DirectoryIndex tag for the second
vserver is missing!  This is despite my directly specifying a DirectoryIndex for
the second vserver using the tool.

Additional info:

To fix this error I simply needed to add the following line to the second
vserver config in httpd.conf:
"DirectoryIndex index.html index.php, index.htm, index.shtml" or something to
that effect.

It is also interesting that ErrorLog and TransferLog are written in twice, but I
have not experimented with it enough to confirm it is a separate bug.

Comment 1 Cole Goeppinger 2004-05-13 00:49:54 UTC
I've noticed that redhat-config-httpd adds the following to httpd.conf:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the 
# same purpose, but it is much slower.
#
DirectoryIndex 

The problem is that since there are no default DirectoryIndex files
defined, the only files used to index are the ones explitly added in
each <VirtualHosts> entry.  This wouldn't be so bad except that no
DirectoryIndex entries are added to the VirtualHost unless the list
differs from the default list.  So every time one wants to add a
VirtualHost they have edit the "Directory Page Search List"  to differ
from the default just to get them added.

Comment 2 Phil Knirsch 2004-09-01 13:30:28 UTC

*** This bug has been marked as a duplicate of 89947 ***

Comment 3 Red Hat Bugzilla 2006-02-21 18:56:38 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


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