我正在尝试使用 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>
2个域的位置:
/Applications/XAMPP/xampfiles/htdocs
感谢您对此事的任何帮助