【问题标题】:Apache 2.4.46 virtual hosts on windows 10Windows 10 上的 Apache 2.4.46 虚拟主机
【发布时间】:2021-05-29 04:43:49
【问题描述】:

我在 httpd-vhosts.conf 中配置了一个虚拟主机,当我在 httpd.conf 上启用(未注释的)虚拟主机并尝试访问本地主机或本地内部未在 v-host 中配置的任何链接时,总是向我展示 Forbidden 您无权访问此资源。

(httpd-vhosts.conf)


    <VirtualHost *:80>
        ServerName workshop.test
        ServerAlias www.workshop.test
        DocumentRoot "C:/Apache24/htdocs/workshop/workshop_app/public"
        ErrorLog "logs/workshop.test-error.log"
        CustomLog "logs/workshop.test-access.log" common
    </VirtualHost>

(httpd.conf)

    Include conf/extra/httpd-vhosts.conf

【问题讨论】:

标签: windows apache httpd.conf vhosts


【解决方案1】:

在你的workshop.test vhost 块中添加这个:

<Directory "C:/Apache24/htdocs/workshop/workshop_app/public">
    DirectoryIndex index.php
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Require all granted
</Directory>

【讨论】:

  • 我试试这个,但问题仍然存在。如果我使用虚拟主机,我将无法使用 localhost 链接,例如 (localhost/phpmyadmin) 总是返回 Forbidden 您无权访问此资源
  • httpd.conf 中,您是否为UserGroup 设置了正确的值?
  • httpd.conf这个东西我没有改,应该怎么配置?
  • 它必须是您的用户名和您所属的主要组
猜你喜欢
  • 2017-10-12
  • 2017-03-22
  • 2013-12-19
  • 2010-11-02
  • 2011-02-09
  • 2011-05-13
  • 2012-10-16
  • 2011-06-19
  • 2014-06-15
相关资源
最近更新 更多