Apache 如果DocumentRoot在httpd.conf中被注释掉,那么httpd从何处提供内容?
我很想知道是否有一种方法可以使用一些控制工具来找到它。似乎apachectl做不到,但也许可以 编辑:我应该补充一点,那就是Apache 如果DocumentRoot在httpd.conf中被注释掉,那么httpd从何处提供内容?,apache,httpd.conf,document-root,Apache,Httpd.conf,Document Root,我很想知道是否有一种方法可以使用一些控制工具来找到它。似乎apachectl做不到,但也许可以 编辑:我应该补充一点,那就是 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 并且apache文档“”指定的“默认”Document
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
并且apache文档“”指定的“默认”DocumentRoot不存在
# ls -la /usr/local/apache/htdocs
ls: cannot access /usr/local/apache/htdocs: No such file or directory
DocumentRoot
的默认值是“/usr/local/apache/htdocs”
,由指定
您可以通过bash扫描所有apache conf文件来检查是否指定了DocumentRoot
:
grep -r "DocumentRoot" /etc/httpd
# or
grep -r "DocumentRoot" /etc/apache2