【问题标题】:permission denied virtual hosts xampp权限被拒绝的虚拟主机 xampp
【发布时间】:2013-06-30 07:52:42
【问题描述】:

我正在尝试使用 mac 在 xampp 上加载一些虚拟主机。

其中一个给我 403 错误,另一个重定向到 xampp 控制页面,无论我将什么目录添加到根虚拟主机域

domain.local = domain.local/xampp

domain.local/index.php = domain.local/xampp(有一个有效的index.php)

我的主机文件

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       domain
127.0.0.1       domain2

我的 httpd.conf 文件

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/Applications/XAMPP/htdocs/domain1">
  AllowOverride FileInfo
</Directory>

<Directory "/Applications/XAMPP/htdocs/domain2">
  AllowOverride FileInfo
</Directory>

我的 httpd-vhosts.conf

    NameVirtualHost *
<VirtualHost *:80>
    ServerAdmin domain.local
    DocumentRoot "/Applications/XAMPP/htdocs/domain"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
    <Directory "/Applications/XAMPP/htdocs/domain">
        AllowOverride All

        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin domain2.local
    DocumentRoot "/Applications/XAMPP/htdocs/domain2"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
    <Directory "/Applications/XAMPP/htdocs/domain2">
        AllowOverride All

        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

两个域的位置:

/Applications/XAMPP/xampfiles/htdocs

感谢您对此事的任何帮助

【问题讨论】:

    标签: macos xampp virtualhost http-status-code-403


    【解决方案1】:

    按 Ctrl+F 并在 httpd.conf 文件中搜索 DocumentRoot。在那里你应该找到 2 个地方来设置你的 DocumentRoot。那是您已授予访问权限的文件夹。 (403 错误是因为无权访问此文件夹)我使用的是 Windows,所以这是我能解决这个问题的最接近的方法。

    【讨论】:

      猜你喜欢
      • 2012-12-28
      • 2015-01-04
      • 2011-04-12
      • 2019-06-14
      • 2020-01-27
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      相关资源
      最近更新 更多