Bug 147761 - DOCUMENT_ROOT not set correctly when VirtualDocumentRoot is used
Summary: DOCUMENT_ROOT not set correctly when VirtualDocumentRoot is used
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-02-11 00:39 UTC by Jeff MacDonald
Modified: 2008-02-15 06:34 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-02-15 06:34:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jeff MacDonald 2005-02-11 00:39:16 UTC
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):
httpd-2.0.51-1.6.legacy

How reproducible:
Always

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 10:36:19 UTC
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 17:37:32 UTC
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 17:40:02 UTC
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.

Thanks!

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 18:14:06 UTC
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
'/var/www/html'

I've changed the version information on this bug so it is accurate.


Comment 5 petrosyan 2008-02-15 06:34:22 UTC
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.