【问题标题】:Apache searches for old DocumentRoot after editing the config file and restarting itApache 在编辑配置文件并重新启动后搜索旧 DocumentRoot
【发布时间】:2011-10-19 06:52:07
【问题描述】:

我正在使用 Arch Linux 3.0-ARCH。我已将/etc/httpd/conf/httpd.conf 中的DocumentRoot/srv/http 更改为/var/www。然后我发出了这个命令:

% sudo /etc/rc.d/httpd restart
:: Restarting Apache Web Server                                           [BUSY] 
Warning: DocumentRoot [/srv/http] does not exist

虽然如果我将文件复制到/var/www,它们可以在本地主机上看到。 我设置了正确的权限——/var/www 归 root 所有,它的组是www。我和 Apache 运行的 http 用户都是该组的成员。该目录的权限为775

【问题讨论】:

  • 您是否有其他 .conf 文件?或者不止一个 VirtualHost,其中一个包含旧的 DocumentRoot 路径?您可能已经检查过那些,但我认为询问并没有什么坏处。 :)

标签: apache http apache2 httpd.conf archlinux


【解决方案1】:

您检查过这些设置吗?

/etc/httpd/conf/extra/httpd-ssl.conf
/etc/httpd/conf/extra/httpd-userdir.conf
/etc/httpd/conf/extra/httpd-vhosts.conf

【讨论】:

  • +1,因为如果将来有人有类似问题,这可能会很有用。
【解决方案2】:

发出这个命令:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v vhost | grep -v log

这个命令会告诉你在寻找什么 /srv/http/ 目录

如果您启用了虚拟主机,请改用这个:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v log

【讨论】:

  • 我早该想到的! +1,因为如果将来有人有类似问题,这可能会很有用。
猜你喜欢
  • 1970-01-01
  • 2015-03-18
  • 2016-01-11
  • 2017-06-19
  • 2023-03-18
  • 2012-02-28
  • 1970-01-01
  • 2011-12-26
  • 2018-01-30
相关资源
最近更新 更多