【问题标题】:Where is httpd serving content from if DocumentRoot is commented out in httpd.conf?如果 DocumentRoot 在 httpd.conf 中被注释掉,那么 httpd 从哪里提供内容?
【发布时间】:2018-03-19 20:01:03
【问题描述】:

很想知道是否有办法使用一些控制实用程序来找出它。似乎 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 docs '' 指定的“默认” DocumentRoot 不存在

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

【问题讨论】:

    标签: apache httpd.conf document-root


    【解决方案1】:

    DocumentRoot 的默认值为"/usr/local/apache/htdocs",由apache docs 指定。

    您可以通过 bash 扫描所有 apache conf 文件来检查是否指定了 DocumentRoot

    grep -r "DocumentRoot" /etc/httpd
    
    # or
    
    grep -r "DocumentRoot" /etc/apache2
    

    【讨论】:

      猜你喜欢
      • 2017-12-26
      • 1970-01-01
      • 2020-09-26
      • 1970-01-01
      • 2015-08-07
      • 2014-02-12
      • 1970-01-01
      • 2021-09-09
      • 2020-07-25
      相关资源
      最近更新 更多