Randall Stevens
Randall Stevens

Reputation: 596

Where is httpd serving content from if DocumentRoot is commented out in httpd.conf?

Would love to know if there's a way to use some control utility to find it out. Doesn't seem like apachectl can do it, but maybe it can.

Edit: I should probably add that it's

root# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
root# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Oct 19 2017 20:39:16

and that the "default" DocumentRoot as specified by apache docs '' does not exist

# ls -la /usr/local/apache/htdocs
ls: cannot access /usr/local/apache/htdocs: No such file or directory

Upvotes: 2

Views: 375

Answers (1)

Ben
Ben

Reputation: 5129

The default value of DocumentRoot is "/usr/local/apache/htdocs", as specified by apache docs.

You may check if the DocumentRoot is specified by scanning all the apache conf files by bash:

grep -r "DocumentRoot" /etc/httpd

# or

grep -r "DocumentRoot" /etc/apache2

Upvotes: 2

Related Questions