Which struct stores DocumentRoot in Apache 2?

Dr. Klahn
Dr. Klahn used Ask the Experts™
Which data structure contains information corresponding to the DocumentRoot directive  in Apache 2.x?

I expected it to be path in server_rec, but server_rec->path returns null.  Nor is it in request_rec.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Guessing you're asking because your writing your own Apache module.

This question is better asked in the Apache forums.

Another trick your can use is to look at GitHub projects for custom Apache modules + see how they pull out data from various structures.
Expert of the Year 2008
Top Expert 2008
On the urls that you posted, there is a "Search" option on the top-right. Using that feature it reveals:

Expand/Look under "Core HTTPD Daemon"
Dr. KlahnPrincipal Software Engineer


Thank you.  (Strange place to put a per-server definition.)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial