This article provides a guide for how to find Apache Document Root in CentOS server.
What is Document Root?
The DocumentRoot is the top-level directory in the document tree visible from the web. This directive sets the directory in the configuration from which Apache2 or HTTPD looks for and serves web files.
For example:
DocumentRoot "/var/www/html"
Finding Apache Document Root in CentOS
Follow the steps below to locate the Apache Document Root of CentOS server.
- Login to your CentOS server via SSH
- Run the following commands:
grep -i 'DocumentRoot' /etc/httpd/conf/httpd.conf
grep -i 'DocumentRoot' /etc/httpd/conf.d/ssl.conf - Find Location of Document Root in response:
# DocumentRoot: The directory out of which you will serve your DocumentRoot "/var/www/html"
From this we can determine the Document Root is located at /var/www/html
RELATED: How to Change Document Root Location