xampp在mavericks上设置虚拟主机

xampp在mavericks上设置虚拟主机,xampp,vhosts,Xampp,Vhosts,我已经在我的mavericks上安装了xampp,我已经完成了虚拟主机的配置,即使我认为我可以自己完成,但它仍然不起作用。我在任何地方都找不到问题,我查看了所有可能与此有关的文件,重写了/etc/hosts文件。/xamppfiles/etc/extra/httpd vhosts.conf和。/xamppfiles/etc/httpd.conf,但当我进入浏览器并键入vhosts指定的地址时,它就不起作用了,它让我联想到谷歌搜索。我还试图添加另一个vhost,但同样的情况也发生了 我的vhost

我已经在我的mavericks上安装了xampp,我已经完成了虚拟主机的配置,即使我认为我可以自己完成,但它仍然不起作用。我在任何地方都找不到问题,我查看了所有可能与此有关的文件,重写了
/etc/hosts
文件
。/xamppfiles/etc/extra/httpd vhosts.conf
。/xamppfiles/etc/httpd.conf
,但当我进入浏览器并键入vhosts指定的地址时,它就不起作用了,它让我联想到谷歌搜索。我还试图添加另一个vhost,但同样的情况也发生了

我的vhosts文件如下所示: 名称虚拟主机*:80

# localhost
<VirtualHost *:80>
ServerName "localhost"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/xampp"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/xampp">
    Options Indexes FollowSymLinks Includes execCGI
    AllowOverride All
    Allow From All
    Order Allow,Deny
</Directory>
</VirtualHost>


# My custom host
<VirtualHost *:80>
ServerName "site1.local"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1">
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
    AllowOverride All
    Require all granted
</Directory>
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log"
</VirtualHost>
并在httpd.conf中取消对该行的注释

Include etc/extra/httpd-vhosts.conf
通过将.htaccess文件重命名为htaccess并注释掉所有内容,我已禁用了该文件

我真的不知道还能做什么,但它仍然不起作用:-/


我没有忘记分别重新启动apache服务器。

您的vhost文件缺少反斜杠。应该是这样的:

#本地主机
服务器名“本地主机”
DocumentRoot“/Applications/XAMPP/xamppfiles/htdocs/XAMPP”
选项索引如下SYMLINKS包括execCGI
允许超越所有
通融
命令允许,拒绝
#我的定制主机
服务器名“site1.local”
DocumentRoot“/Applications/XAMPP/xamppfiles/htdocs/site1”
选项索引如下SYMLINKS包括ExecCGI
命令允许,拒绝
通融
允许超越所有
要求所有授权
错误日志“Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log”
放在浏览器上
http://site1.local/
它应该是有效的

Include etc/extra/httpd-vhosts.conf
# localhost
<VirtualHost *:80>
ServerName "localhost"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/xampp"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/xampp/">
    Options Indexes FollowSymLinks Includes execCGI
    AllowOverride All
    Allow From All
    Order Allow,Deny
</Directory>
</VirtualHost>
# My custom host
<VirtualHost *:80>
ServerName "site1.local"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1/">
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
    AllowOverride All
    Require all granted
</Directory>
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log"
</VirtualHost>