www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Patterson <jim-patter...@ncf.ca>
Subject config/6272: ServerName directive ignored
Date Mon, 03 Jul 2000 14:45:00 GMT

>Number:         6272
>Category:       config
>Synopsis:       ServerName directive ignored
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Jul 03 07:50:00 PDT 2000
>Originator:     jim-patterson@ncf.ca
>Release:        2.0a4
Windows 2000
Visual C++ 5.0 SP3
My computer does not have a Fully Qualified Domain Name (FQDN) and so 
I must resort to using the ServerName directive. However, even when I specify
ServerName in httpd.conf, Apache version 2.0a4 still fails on startup with a message: 
  Apache.exe: cannot determine local host name
Run Apache on a machine that does not have a FQDN.
The configuration routines seem to expect a servername before they are
done walking the configuration tree, that is, before the server name has
been transfered from the configuration tree to the in-memory structures.
The main config file is loaded from apache_main by calling ap_read_config . 
Here is a traceback at the point where it's complaining about no "ServerName":
  ap_get_local_host(ap_pool_t * 0x00654130) line 1981
  ap_fini_vhost_config(ap_pool_t * 0x00654130, server_rec * 0x00654a38) line 487 + 9 bytes
  ap_read_config(process_rec * 0x0065211c, ap_pool_t * 0x006765b4, char * 0x00650160, ap_directive_t
* * 0x0063dd84) line 1594 + 13 bytes
  apache_main(int 5, char * * 0x00650198) line 383 + 22 bytes
  main(int 3, char * * 0x00760bf0) line 468 + 16 bytes
The problem is that it isn't until ap_process_config is called later on that
the ServerName directive is processed. Consequently, the check in ap_fini_vhost_config
will always find that the server name has not been set, and set it to the default
hostname. This works as long as a FQDN is available but causes an unavoidable
start failure otherwise.
It seems that the call to ap_fini_vhost_config has to be deferred, but I don't
know enough about the process to suggest where it should go.
 [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!     ]

View raw message