Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 147761 - DOCUMENT_ROOT not set correctly when VirtualDocumentRoot is used
DOCUMENT_ROOT not set correctly when VirtualDocumentRoot is used
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
Depends On:
  Show dependency treegraph
Reported: 2005-02-10 19:39 EST by Jeff MacDonald
Modified: 2008-02-15 01:34 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-15 01:34:22 EST
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 Jeff MacDonald 2005-02-10 19:39:16 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Description of problem:
I am writing a php script that indexes directories (a "directory indexer"). I have configured apache to use the VirtualDocumentRoot directive so it is easier to set up virtual hosts. While troubleshooting a problem with directories not being displayed correctly, I noticed that $_SERVER["DOCUMENT_ROOT"] is not set correctly-- in fact, it is set to "/etc/httpd/htdocs" which does not exist. I have not tested in a "normal" virtual host environment, but I "assume" the problem does not exist there.

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

How reproducible:

Steps to Reproduce:
1. configure apache using VirtualDocumentRoot
2. call phpinfo() and examine value for $_SERVER["DOCUMENT_ROOT"]
3. on my machine it is /etc/httpd/htdocs which does not exist, and it is invalid.

Actual Results:  wrong value for DOCUMENT_ROOT

Expected Results:  correct value for DOCUMENT_ROOT

Additional info:
Comment 1 Joe Orton 2005-02-11 05:36:19 EST
DOCUMENT_ROOT is just the value of the DocumentRoot setting; it's also not
affected by Alias etc. (VirtualDocumentRoot is much like a clever Alias).

Can you use SCRIPT_FILENAME or such instead?
Comment 2 Jeff MacDonald 2005-02-11 12:37:32 EST
in my case, SCRIPT_FILENAME is set to "/nfs/gate/common/directoryindex.php"
which is the filesystem path to the directory indexer script. 

REQUEST_URI is set to, for example, "/projects". In order to access that
directory on the filesystem, I would normally prepend DOCUMENT_ROOT, but since
it does not have the right value I cannot do it that way.

I looked through all of the $_SERVER variables to see if there was something I
could prepend reliably to make this work, and DOCUMENT_ROOT is the only thing I
could come up with.

please let me know if you need more information-- I can attach httpd.conf and
directoryindex.php if that will help.
Comment 3 Matthew Miller 2006-07-11 13:40:02 EDT
Fedora Core 1 is maintained by the Fedora Legacy project for security updates
only. If this problem is a security issue, please reopen and reassign to the
Fedora Legacy product. If it is not a security issue and hasn't been resolved in
the current FC5 updates or in the FC6 test release, reopen and change the
version to match.


NOTE: Fedora Core 1 is reaching the final end of support even by the Legacy
project. After Fedora Core 6 Test 2 is released (currently scheduled for July
26th), there will be no more security updates for FC1. Please use these next two
weeks to upgrade any remaining FC1 systems to a current release.

Comment 4 Jeff MacDonald 2006-07-11 14:14:06 EDT
I have long since upgraded the host in question to FC4, and it has the same
issues with DOCUMENT_ROOT.

DOCUMENT_ROOT *should* be set to
'/nfs/zoidtechnologies.com/gate/<host>/<port>/html/', but instead it is

I've changed the version information on this bug so it is accurate.
Comment 5 petrosyan 2008-02-15 01:34:22 EST
Fedora Core 4 is not maintained anymore.

Setting status to "INSUFFICIENT_DATA". If you can reproduce this bug in the
current Fedora release, please reopen this bug and assign it to the
corresponding Fedora version.

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