CentOs7 ApacheのDocumentRoot(ドキュメントルート)をコマンドで確認する方法

CentOs7 ApacheのDocumentRoot(ドキュメントルート)をコマンドで確認する方法

ApacheのDocumentRoot(ドキュメントルート)をコマンド一発で、確認する方法です。調査する機会があったので、記述してます。

環境

  • OS CentOS Linux release 7.7.1908 (Core)
  • Apache/2.4.6

確認方法

grepを利用して確認

grep -i 'DocumentRoot' /etc/httpd/conf/httpd.conf

<出力結果>
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/var/www/html"
# access content that does not live under the DocumentRoot.

ssl.confも確認できます。

grep -i 'DocumentRoot' /etc/httpd/conf.d/ssl.conf

<出力結果>
#DocumentRoot "/var/www/html"