www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Hughes <k...@kyhm.com>
Subject config/7895: Some VirtualHost ErrorLog entries cause apache to die silently on startup
Date Wed, 20 Jun 2001 22:26:13 GMT

>Number:         7895
>Category:       config
>Synopsis:       Some VirtualHost ErrorLog entries cause apache to die silently on startup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Jun 20 15:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     kyhm@kyhm.com
>Release:        1.3.19
>Organization:
apache
>Environment:
RedHat 6.1, Linux 2.2.17 #6 SMP Mon Mar 26 16:40:56 PST 2001 i586 unknown
Apache/1.3.19 (Unix), built Mar 29 2001 10:55:40
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Description:
Ok, I have a development server (fuji, 192.168.1.16) with name-based virtual hosts, and a
working intranet with onsite DNS.  For some of  VirtualHosts, setting the ErrorLog directive
causes Apache to silently die during startup.  No messages appear in the server's main ErrorLog
(even with LogLevel debug set).  

Commenting out the offending entries is the workaround, though error messages are routed to
the main ErrorLog.  However the workaround makes it difficult to separate debugging messages
for different projects, which is why I'm using VirtualHosts to begin with.

What is interesting (= frustrating!) about this is that all configs are generated from boilerplate
with scripts, all permissions are likewise set, etc. and the same for all VirtualHosts.  Even
with all permissions set wide open (log dir 777, logs 666) no joy.  Thus I get different behaviours
on identical configurations. 

Lastly, while 'apachectl configtest' says Syntax OK, 'apachectl restart' says 
    configuration broken, ignoring restart 
    (run 'apachectl configtest' for details)

Some details:

My virtual hosts each have a tree under /Virtual (symlink to /home/virtual), like so:
  /Virtual
  |-- DEFAULT -> /home/httpd/
  |-- ICONS/
  |-- foo/
  |   |-- cgi-bin/
  |   |-- etc/
  |   |   `-- httpd.conf
  |   |-- htdocs/
  |   `-- logs/
  |       |-- access_log
  |       `-- error_log
  `-- bar/
      |-- cgi-bin/
      |-- etc/
      |   `-- httpd.conf
      |-- htdocs/
      `-- logs/
          |-- access_log
          `-- error_log


My /etc/httpd/httpd.conf includes a file, /etc/httpd/virtual.conf, which defines the default
(ie, first name-based) server and the virtual servers.  For each virtual server, it includes
the httpd.conf file in the appropriate directory.

    NameVirtualHost 192.168.1.16
 
    <VirtualHost 192.168.1.16>
        ServerName   fuji.network.int
        ServerAlias  fuji
        ServerAdmin  webmaster@fuji.network.int

        DocumentRoot  /Virtual/DEFAULT/htdocs
        ScriptAlias   /cgi-bin /Virtual/DEFAULT/cgi-bin
        ErrorLog      /Virtual/DEFAULT/logs/error_log
        TransferLog   /Virtual/DEFAULT/logs/access_log
        Alias         /icons /Virtual/ICONS

        <Location />
            Options Indexes Includes FollowSymLinks MultiViews
        </Location>
    </VirtualHost>

    <VirtualHost 192.168.1.16>
        Include /Virtual/foo/etc/httpd.conf
    </VirtualHost>

    <VirtualHost  192.168.1.16>
        Include /Virtual/bar/etc/httpd.conf
    </VirtualHost>


The included files such as /Virtual/foo/etc/httpd.conf and /Virtual/bar/etc/httpd.conf are
generated by a script, and thus boilerplate:

/Virtual/foo/etc/httpd.conf:
    ServerName   www.foo.virt
    ServerAlias  foo.virt
    ServerPath   /foo
    ServerAdmin  webmaster@foo.virt

    DocumentRoot  /Virtual/foo/htdocs
    ScriptAlias   /cgi-bin /Virtual/foo/cgi-bin
    ErrorLog      /Virtual/foo/logs/error_log
    TransferLog   /Virtual/foo/logs/access_log
    Alias         /icons /Virtual/ICONS

    <Location />
        Options Indexes Includes FollowSymLinks MultiViews
    </Location>

    
/Virtual/bar/etc/httpd.conf:    
    ServerName   www.bar.virt
    ServerAlias  bar.virt
    ServerPath   /bar
    ServerAdmin  webmaster@bar.virt

    DocumentRoot  /Virtual/bar/htdocs
    ScriptAlias   /cgi-bin /Virtual/bar/cgi-bin
    ErrorLog      /Virtual/bar/logs/error_log
    TransferLog   /Virtual/bar/logs/access_log
    Alias         /icons /Virtual/ICONS

    <Location />
        Options Indexes Includes FollowSymLinks MultiViews
    </Location>


Each site has a user and group associated with it, to own the files.  Apache runs as nobody,
who owns the logfiles.  Permissions are set appropriately for the file/directories:

drwxrwsr-x  2 foo      foo      4096 Apr 11 11:52 /Virtual/foo/logs/
-rw-r--r--  1 nobody   foo   2857828 Jun 20 10:46 /Virtual/foo/logs/access_log
-rw-r--r--  1 nobody   foo    112760 Jun 19 16:03 /Virtual/foo/logs/error_log

drwxrwsr-x  2 bar      bar      4096 Jun 20 11:59 /Virtual/bar/logs/
-rw-r--r--  1 nobody   bar         0 Jun 20 10:46 /Virtual/bar/logs/access_log
-rw-r--r--  1 nobody   bar         0 Jun 19 16:03 /Virtual/bar/logs/error_log
 

>How-To-Repeat:
Create /etc/httpd/virtual.conf as described above, symlink /Virtual to an appropriate location,
and use my CREATE script to create some sites.  This may or may not work, as on my system.
 CREATE requires my mpause utility, both may be found at http://kyhm.com/pr/
>Fix:
Not yet
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
 
 


Mime
View raw message