我已经在我的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发布于 2013-10-18 00:56:17
我认为您可能是在启用了SELinux的情况下运行的。这需要额外的步骤来使资源可访问(这对安全性有好处)。
以下问题提供了有关如何启用DocumentRoot的指导原则:
如果不想使用SELinux,可以通过在/etc/selinux/config中设置SELINUX=disabled来禁用它。如果您想了解更多信息,以下链接可能会有所帮助。
发布于 2013-12-19 19:55:44
尝试移动html文件夹中的vhosts文件夹,并通过运行以下命令更改SELinux安全上下文
chcon -R --reference=/var/www/html /var/www/html/vhosts
https://stackoverflow.com/questions/19416757
复制相似问题