https://issues.apache.org/bugzilla/show_bug.cgi?id=52139
Bug #: 52139
Summary: Never Syntax Error on non-existent DocumentRoot
Product: Apache httpd-2
Version: 2.2.21
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Right now Apache has two different behaviors with respect to an invalid
DocumentRoot: if it's a VirtualHost, it only warns if the DocumentRoot is
invalid; if it's not a VirtualHost, it will "Syntax Error" and bail out.
I suggest that we should always warn if there is an invalid DocumentRoot, and
never fail if it is invalid. This is handy if your DocumentRoot is, say, on a
network mounted filesystem, which may not have come up by the time Apache runs
(but will come up soon!)
The patch for this is very simple:
--- server/core.c.bak 2011-11-05 03:15:37.000000000 -0400
+++ server/core.c 2011-11-05 03:15:39.000000000 -0400
@@ -1211,16 +1211,11 @@
if (apr_filepath_merge((char**)&conf->ap_document_root, NULL, arg,
APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS
|| !ap_is_directory(cmd->pool, arg)) {
- if (cmd->server->is_virtual) {
- ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0,
- cmd->pool,
- "Warning: DocumentRoot [%s] does not exist",
- arg);
- conf->ap_document_root = arg;
- }
- else {
- return "DocumentRoot must be a directory";
- }
+ ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0,
+ cmd->pool,
+ "Warning: DocumentRoot [%s] does not exist",
+ arg);
+ conf->ap_document_root = arg;
}
return NULL;
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]