gpt4 book ai didi

apache - “Warning: DocumentRoot [/var/www/vhosts] does not exist” 虽然我已经创建了/var/www/vhosts?

转载 作者:行者123 更新时间:2023-12-04 15:23:10 29 4
gpt4 key购买 nike

我已经在 CentOS 6.4 上安装了 apache 并配置了我的虚拟主机。

但是,当我重新启动 apache(使用此命令:sudo service httpd restart)时,它警告我“警告:DocumentRoot [/var/www/vhosts] 不存在”。我检查了目录/var/www/vhosts,它已经创建并且权限是0777。我做错了什么?任何帮助请...

-> 这是我的虚拟主机配置。

DocumentRoot /var/www/vhosts
ServerName trien.cba
ServerAlias trien.cba
ErrorLog /var/log/httpd/trien.cba.error.log
CustomLog /var/log/httpd/trien.cba.access.log common
AllowOverride All
Order allow,deny
Allow from all
Options -Indexes

....

-> 这是警告:
[root@test-cba ~]#sudo service httpd restart
Stopping httpd: [ OK ]
Starting httpd: Warning: DocumentRoot [/var/www/vhosts] does not exist
Warning: DocumentRoot [/var/www/vhosts] does not exist

最佳答案

我认为您可能在启用 SELinux 的情况下运行。这需要额外的步骤来使资源可访问(这有利于安全)。

这些问题提供了有关如何启用 DocumentRoot 的指南:

  • https://serverfault.com/questions/293866/apache-says-documentroot-doesnt-exist-when-it-does
  • https://serverfault.com/questions/323511/selinux-on-rhel6-httpd-config-documentroot-path-does-exist-does-not-exist

  • 如果您不想使用 SELinux,可以通过设置 SELINUX=disabled 来禁用它。在/etc/selinux/config.d/如果您想了解更多信息,以下链接可能会有所帮助。
  • http://wiki.centos.org/HowTos/SELinux
  • http://fedoraproject.org/wiki/SELinux
  • 关于apache - “Warning: DocumentRoot [/var/www/vhosts] does not exist” 虽然我已经创建了/var/www/vhosts?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19416757/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com